This commit is contained in:
2025-04-07 12:16:11 +01:00
parent ce8b201a1c
commit e15a80163b
62 changed files with 149 additions and 131 deletions

View File

@@ -38,4 +38,4 @@ test('users can logout', function () {
$this->assertGuest();
$response->assertRedirect('/');
});
});

View File

@@ -43,4 +43,4 @@ test('email is not verified with invalid hash', function () {
$this->actingAs($user)->get($verificationUrl);
expect($user->fresh()->hasVerifiedEmail())->toBeFalse();
});
});

View File

@@ -29,4 +29,4 @@ test('password is not confirmed with invalid password', function () {
]);
$response->assertSessionHasErrors();
});
});

View File

@@ -57,4 +57,4 @@ test('password can be reset with valid token', function () {
return true;
});
});
});

View File

@@ -22,4 +22,4 @@ test('new users can register', function () {
assertTrue(auth()->user()->ownedOrganisations()->count() === 1);
$response->assertRedirect(route('dashboard', absolute: false));
});
});

View File

@@ -13,4 +13,4 @@ test('authenticated users can visit the dashboard', function () {
$response = $this->get('/dashboard');
$response->assertStatus(200);
});
});

View File

@@ -4,4 +4,4 @@ test('returns a successful response', function () {
$response = $this->get('/');
$response->assertStatus(200);
});
});

View File

@@ -5,8 +5,6 @@ use App\Data\ServerProviders\CreatedServer;
use App\Models\Organisation;
use App\Models\Server;
use App\Models\User;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str;
use Inertia\Testing\AssertableInertia;
@@ -27,7 +25,7 @@ test('index route displays servers for an organisation', function () {
$response = $this->get(route('servers.index', ['organisation' => $organisation->id]));
$response->assertStatus(200);
$response->assertInertia(fn(AssertableInertia $page) => $page
$response->assertInertia(fn (AssertableInertia $page) => $page
->component('servers/Index'));
});
@@ -35,7 +33,7 @@ test('create route returns inertia view', function () {
$organisation = Organisation::factory()->create();
$response = $this->get(route('servers.create', ['organisation' => $organisation->id]));
$response->assertStatus(200);
$response->assertInertia(fn(AssertableInertia $page) => $page
$response->assertInertia(fn (AssertableInertia $page) => $page
->component('servers/Create'));
});
@@ -67,7 +65,7 @@ test('store route creates a server with valid data', function () {
ipv6: '::1',
status: 'running',
rootPassword: Str::random(16),
)
)
);
$mock->shouldReceive('execute')->andReturn($providerMock);
@@ -95,10 +93,10 @@ test('show route displays a single server', function () {
$response = $this->get(route('servers.show', [
'organisation' => $organisation->id,
'server' => $server->id
'server' => $server->id,
]));
$response->assertStatus(200);
$response->assertInertia(fn(AssertableInertia $page) => $page
$response->assertInertia(fn (AssertableInertia $page) => $page
->component('servers/Show'));
});

View File

@@ -37,4 +37,4 @@ test('correct password must be provided to update password', function () {
$response
->assertSessionHasErrors('current_password')
->assertRedirect('/settings/password');
});
});

View File

@@ -100,4 +100,4 @@ test('correct password must be provided to delete account', function () {
->assertRedirect('/settings/profile');
expect($user->fresh())->not->toBeNull();
});
});

View File

@@ -2,4 +2,4 @@
test('that true is true', function () {
expect(true)->toBeTrue();
});
});