TenantAtlas/apps/platform/tests/Feature/TenantConfiguration/Spec426ExchangeTeamsClaimGuardFeatureTest.php
Ahmed Darrazi fb4dc20cb0
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 5m11s
feat: implement Exchange Teams evidence identity readiness
2026-07-03 13:41:08 +02:00

33 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\TenantConfigurationResourceType;
use App\Services\TenantConfiguration\ClaimGuard;
use App\Services\TenantConfiguration\ResourceTypeRegistry;
use App\Support\TenantConfiguration\ClaimState;
it('Spec426 persists only internal claim posture for selected Exchange and Teams resource types', function (): void {
app(ResourceTypeRegistry::class)->syncDefaults();
$claimStates = TenantConfigurationResourceType::query()
->whereIn('canonical_type', ['transportRule', 'acceptedDomain', 'appPermissionPolicy', 'meetingPolicy'])
->orderBy('canonical_type')
->get()
->mapWithKeys(fn (TenantConfigurationResourceType $row): array => [
(string) $row->canonical_type => $row->default_claim_state,
])
->all();
expect($claimStates)->toBe([
'acceptedDomain' => ClaimState::InternalOnly,
'appPermissionPolicy' => ClaimState::InternalOnly,
'meetingPolicy' => ClaimState::InternalOnly,
'transportRule' => ClaimState::InternalOnly,
])
->and(app(ClaimGuard::class)->evaluateStatement('Selected Exchange resources are renderable for internal review', internalOperatorOnly: true))
->toBe(ClaimState::InternalOnly)
->and(app(ClaimGuard::class)->evaluateStatement('Microsoft 365 customer-ready evidence', internalOperatorOnly: true))
->toBe(ClaimState::ClaimBlocked);
});