TenantAtlas/apps/platform/tests/Feature/TenantConfiguration/CoverageV2ReadinessGuardTest.php
Ahmed Darrazi d1f7fbd4c6
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m15s
feat: add coverage v2 operator surface
2026-06-26 14:48:49 +02:00

69 lines
3.3 KiB
PHP

<?php
declare(strict_types=1);
it('keeps the Coverage v2 readiness render path free of remote clients and capture actions', function (): void {
$files = [
app_path('Services/TenantConfiguration/CoverageV2ReadinessReadModel.php'),
app_path('Filament/Pages/TenantConfiguration/CoverageV2Readiness.php'),
app_path('Filament/Widgets/TenantConfiguration/CoverageV2ResourceTypesTable.php'),
app_path('Filament/Widgets/TenantConfiguration/CoverageV2ResourceInstancesTable.php'),
resource_path('views/filament/modals/tenant-configuration/coverage-v2-resource-type-inspect.blade.php'),
resource_path('views/filament/modals/tenant-configuration/coverage-v2-resource-inspect.blade.php'),
];
$content = collect($files)
->map(fn (string $file): string => file_get_contents($file) ?: '')
->implode("\n");
expect($content)
->not->toContain('GraphClient')
->not->toContain('MicrosoftGraph')
->not->toContain('ProviderConnectionResolver')
->not->toContain('StartVerification')
->not->toContain('StartTenantConfigurationCapture')
->not->toContain('TenantConfigurationCaptureJob')
->not->toContain('Http::')
->not->toContain('tenant_id');
});
it('keeps Coverage v2 readiness labels canonical and avoids legacy gap taxonomy', function (): void {
$files = [
app_path('Support/Badges/Domains/CoverageV2ReadinessBadge.php'),
app_path('Support/Badges/Domains/CoverageV2CoverageLevelBadge.php'),
app_path('Support/Badges/Domains/CoverageV2EvidenceStateBadge.php'),
app_path('Support/Badges/Domains/CoverageV2IdentityStateBadge.php'),
app_path('Support/Badges/Domains/CoverageV2ClaimStateBadge.php'),
app_path('Support/Badges/Domains/CoverageV2SupportStateBadge.php'),
app_path('Support/Badges/Domains/CoverageV2SourceClassBadge.php'),
app_path('Services/TenantConfiguration/CoverageV2ReadinessReadModel.php'),
app_path('Filament/Pages/TenantConfiguration/CoverageV2Readiness.php'),
app_path('Filament/Widgets/TenantConfiguration/CoverageV2ResourceTypesTable.php'),
app_path('Filament/Widgets/TenantConfiguration/CoverageV2ResourceInstancesTable.php'),
resource_path('views/filament/pages/tenant-configuration/coverage-v2-readiness.blade.php'),
resource_path('views/filament/modals/tenant-configuration/coverage-v2-resource-type-inspect.blade.php'),
resource_path('views/filament/modals/tenant-configuration/coverage-v2-resource-inspect.blade.php'),
];
$content = collect($files)
->map(fn (string $file): string => file_get_contents($file) ?: '')
->implode("\n");
expect($content)
->toContain('Claim allowed')
->toContain('Claim limited')
->toContain('Claim blocked')
->toContain('Internal only')
->not->toContain('Evidence gaps')
->not->toContain('Raw gaps')
->not->toContain('Primary gaps')
->not->toContain('Partially complete')
->not->toContain('Incomplete result')
->not->toContain('ambiguous_match')
->not->toContain('policy_record_missing')
->not->toContain('foundation_not_policy_backed')
->not->toContain('meta_fallback')
->not->toContain('customer-ready')
->not->toContain('customer ready');
});