TenantAtlas/apps/platform/tests/Unit/Support/ReasonTranslation/TenantOperabilityReasonTranslationTest.php
Ahmed Darrazi 1123b122d9
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 7m13s
feat: cut over tenant core to managed environments
2026-05-07 08:35:42 +02:00

25 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
use App\Support\Governance\PlatformVocabularyGlossary;
use App\Support\Tenants\TenantOperabilityReasonCode;
it('marks already archived tenant states as non-actionable while preserving diagnostics', function (): void {
$envelope = TenantOperabilityReasonCode::TenantAlreadyArchived->toReasonResolutionEnvelope();
expect($envelope->operatorLabel)->toBe('ManagedEnvironment already archived')
->and($envelope->actionability)->toBe('non_actionable')
->and($envelope->guidanceText())->toBe('No action needed.')
->and($envelope->diagnosticCode())->toBe(TenantOperabilityReasonCode::TenantAlreadyArchived->value);
});
it('translates capability denials for tenant-operability outcomes', function (): void {
$envelope = TenantOperabilityReasonCode::MissingCapability->toReasonResolutionEnvelope();
expect($envelope->operatorLabel)->toBe('Permission required')
->and($envelope->shortExplanation)->toContain('missing the capability')
->and(TenantOperabilityReasonCode::MissingCapability->boundaryClassification())->toBe(PlatformVocabularyGlossary::BOUNDARY_PLATFORM_CORE)
->and($envelope->guidanceText())->toBe('Next step: Ask a tenant Owner to grant the required capability.');
});