23 lines
1.0 KiB
PHP
23 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
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('Tenant 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($envelope->guidanceText())->toBe('Next step: Ask a tenant Owner to grant the required capability.');
|
|
});
|