Implemented the first version of provider readiness resolution guidance. Added the ProviderReadinessResolutionAdapter, provider readiness guidance card, and updated EnvironmentRequiredPermissions, ProviderConnectionResource, and ListProviderConnections/ViewProviderConnection. Added tests and updated the design coverage matrix. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #424
71 lines
2.6 KiB
PHP
71 lines
2.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Filament\Resources\ManagedEnvironmentResource;
|
|
use App\Models\ProviderConnection;
|
|
use App\Support\Providers\ProviderConsentStatus;
|
|
use App\Support\Providers\ProviderVerificationStatus;
|
|
|
|
it('renders provider health context on the canonical environment dashboard', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
|
|
$this->actingAs($user)
|
|
->get(ManagedEnvironmentResource::getUrl('view', ['record' => $tenant], tenant: $tenant))
|
|
->assertOk()
|
|
->assertSee('Environment governance overview')
|
|
->assertSee('Provider Health');
|
|
});
|
|
|
|
it('keeps provider health context when the environment needs a default microsoft connection', function (): void {
|
|
$tenant = \App\Models\ManagedEnvironment::factory()->active()->create();
|
|
[$user, $tenant] = createUserWithTenant(
|
|
tenant: $tenant,
|
|
role: 'owner',
|
|
ensureDefaultMicrosoftProviderConnection: false,
|
|
);
|
|
|
|
\App\Models\ProviderConnection::factory()->create([
|
|
'workspace_id' => (int) $tenant->workspace_id,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'provider' => 'microsoft',
|
|
'display_name' => 'Fallback Connection',
|
|
'is_default' => false,
|
|
]);
|
|
|
|
$this->actingAs($user)
|
|
->get(ManagedEnvironmentResource::getUrl('view', ['record' => $tenant], tenant: $tenant))
|
|
->assertOk()
|
|
->assertSee('Environment governance overview')
|
|
->assertSee('Provider Health');
|
|
});
|
|
|
|
it('renders the environment dashboard provider health summary from the default connection posture', function (): void {
|
|
$tenant = \App\Models\ManagedEnvironment::factory()->active()->create();
|
|
[$user, $tenant] = createUserWithTenant(
|
|
tenant: $tenant,
|
|
role: 'owner',
|
|
ensureDefaultMicrosoftProviderConnection: false,
|
|
);
|
|
|
|
ProviderConnection::factory()->create([
|
|
'workspace_id' => (int) $tenant->workspace_id,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'provider' => 'microsoft',
|
|
'display_name' => 'Canonical Summary Connection',
|
|
'is_default' => true,
|
|
'is_enabled' => false,
|
|
'consent_status' => ProviderConsentStatus::Granted->value,
|
|
'verification_status' => ProviderVerificationStatus::Healthy->value,
|
|
]);
|
|
|
|
$this->actingAs($user)
|
|
->get(ManagedEnvironmentResource::getUrl('view', ['record' => $tenant], tenant: $tenant))
|
|
->assertOk()
|
|
->assertSee('Provider Health')
|
|
->assertSee('Disabled')
|
|
->assertSee('Healthy')
|
|
->assertDontSee('Connected')
|
|
->assertDontSee('Legacy health');
|
|
});
|