increase test coverage (#117)

70% test coverage
remove socialite
This commit is contained in:
Saeed Vaziry
2024-03-15 22:23:45 +01:00
committed by GitHub
parent 4f12de9586
commit a406491160
62 changed files with 1102 additions and 639 deletions

View File

@ -3,6 +3,7 @@
namespace Tests\Feature;
use App\Enums\DatabaseStatus;
use App\Enums\DatabaseUserStatus;
use App\Facades\SSH;
use App\Models\Database;
use Illuminate\Foundation\Testing\RefreshDatabase;
@ -28,6 +29,34 @@ public function test_create_database(): void
]);
}
public function test_create_database_with_user(): void
{
$this->actingAs($this->user);
SSH::fake();
$this->post(route('servers.databases.store', $this->server), [
'name' => 'database',
'user' => 'on',
'username' => 'user',
'password' => 'password',
'remote' => 'on',
'host' => '%',
])->assertSessionDoesntHaveErrors();
$this->assertDatabaseHas('databases', [
'name' => 'database',
'status' => DatabaseStatus::READY,
]);
$this->assertDatabaseHas('database_users', [
'username' => 'user',
'databases' => json_encode(['database']),
'host' => '%',
'status' => DatabaseUserStatus::READY,
]);
}
public function test_see_databases_list(): void
{
$this->actingAs($this->user);