wowowowowo
Some checks failed
CI / Lint (push) Failing after 22s
CI / Tests (push) Failing after 33s

This commit is contained in:
2026-05-28 15:15:41 +01:00
parent 8f603122e2
commit 5b977c1f41
129 changed files with 9943 additions and 722 deletions

View File

@@ -0,0 +1,53 @@
<?php
use App\Models\Application;
use App\Models\Environment;
use App\Models\Organisation;
use App\Models\User;
use Inertia\Testing\AssertableInertia;
it('shares environment first navigation context with onboarding counts', function () {
$user = User::factory()->create();
$organisation = Organisation::factory()->create(['owner_id' => $user->id]);
$user->organisations()->attach($organisation, ['role' => 'admin']);
$response = $this->actingAs($user)->get(route('organisations.show', [
'organisation' => $organisation->id,
]));
$response->assertOk();
$response->assertInertia(fn (AssertableInertia $page) => $page
->where('organisation.id', $organisation->id)
->where('organisation.providers_count', 0)
->where('organisation.applications_count', 0));
});
it('lists environments across applications', function () {
$user = User::factory()->create();
$organisation = Organisation::factory()->create(['owner_id' => $user->id]);
$application = Application::factory()->for($organisation)->create();
Environment::factory()->for($application)->create(['name' => 'production']);
$response = $this->actingAs($user)->get(route('environments.index', [
'organisation' => $organisation->id,
]));
$response->assertOk();
$response->assertInertia(fn (AssertableInertia $page) => $page
->component('environments/Index', false)
->has('applications.0.environments', 1));
});
it('shows the server provider create page', function () {
$user = User::factory()->create();
$organisation = Organisation::factory()->create(['owner_id' => $user->id]);
$response = $this->actingAs($user)->get(route('providers.create', [
'organisation' => $organisation->id,
]));
$response->assertOk();
$response->assertInertia(fn (AssertableInertia $page) => $page
->component('providers/Create', false)
->has('providerTypes'));
});