Implement Keystone environment deployments

This commit is contained in:
2026-05-13 16:11:23 +01:00
parent 65d3142d03
commit aa680b25fd
175 changed files with 10258 additions and 740 deletions

View File

@@ -0,0 +1,43 @@
<?php
use App\Enums\SourceProviderType;
use App\Models\Organisation;
use App\Models\User;
use Inertia\Testing\AssertableInertia;
it('shows the create source provider page', function () {
$user = User::factory()->create();
$organisation = Organisation::factory()->create(['owner_id' => $user->id]);
$response = $this->actingAs($user)->get(route('source-providers.create', [
'organisation' => $organisation->id,
]));
$response->assertOk();
$response->assertInertia(fn (AssertableInertia $page) => $page
->component('source-providers/Create', false)
->where('sourceProviderTypes.0', SourceProviderType::GITEA->value));
});
it('stores a source provider for repository onboarding', function () {
$user = User::factory()->create();
$organisation = Organisation::factory()->create(['owner_id' => $user->id]);
$response = $this->actingAs($user)->post(route('source-providers.store', [
'organisation' => $organisation->id,
]), [
'name' => 'Gitea',
'type' => SourceProviderType::GITEA->value,
'url' => 'https://gitea.example.com/',
]);
$response->assertRedirect(route('organisations.show', [
'organisation' => $organisation->id,
]));
$sourceProvider = $organisation->sourceProviders()->firstOrFail();
expect($sourceProvider->name)->toBe('Gitea')
->and($sourceProvider->type)->toBe(SourceProviderType::GITEA)
->and($sourceProvider->url)->toBe('https://gitea.example.com');
});