Some checks failed
Main Confidence / confidence (push) Failing after 58s
## Summary - remove deprecated baseline profile status alias constants and keep baseline lifecycle semantics on the canonical enum path - retire the dead tenant app-status badge/default-fixture residue from the active runtime support path - add the `234-dead-transitional-residue` spec, plan, research, data-model, quickstart, checklist, and task artifacts plus focused regression assertions ## Validation - not rerun during this PR creation step Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #270
64 lines
2.6 KiB
PHP
64 lines
2.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Support\Badges\BadgeCatalog;
|
|
use App\Support\Badges\BadgeDomain;
|
|
|
|
it('maps tenant status values to canonical badge semantics', function (): void {
|
|
$active = BadgeCatalog::spec(BadgeDomain::TenantStatus, 'active');
|
|
expect($active->label)->toBe('Active');
|
|
expect($active->color)->toBe('success');
|
|
|
|
$archived = BadgeCatalog::spec(BadgeDomain::TenantStatus, 'archived');
|
|
expect($archived->label)->toBe('Archived');
|
|
expect($archived->color)->toBe('gray');
|
|
|
|
$unknown = BadgeCatalog::spec(BadgeDomain::TenantStatus, 'suspended');
|
|
expect($unknown->label)->toBe('Invalid lifecycle');
|
|
expect($unknown->color)->toBe('danger');
|
|
|
|
$error = BadgeCatalog::spec(BadgeDomain::TenantStatus, 'error');
|
|
expect($error->label)->toBe('Invalid lifecycle');
|
|
expect($error->color)->toBe('danger');
|
|
});
|
|
|
|
it('does not expose retired app status as active tenant badge semantics', function (): void {
|
|
$domainValues = collect(BadgeDomain::cases())
|
|
->map(fn (BadgeDomain $domain): string => $domain->value)
|
|
->all();
|
|
|
|
expect($domainValues)->not->toContain('tenant_app_status')
|
|
->and(BadgeCatalog::mapper(BadgeDomain::TenantStatus))->not->toBeNull()
|
|
->and(BadgeCatalog::mapper(BadgeDomain::TenantRbacStatus))->not->toBeNull()
|
|
->and(BadgeCatalog::mapper(BadgeDomain::TenantPermissionStatus))->not->toBeNull();
|
|
});
|
|
|
|
it('maps tenant RBAC status values to canonical badge semantics', function (): void {
|
|
$configured = BadgeCatalog::spec(BadgeDomain::TenantRbacStatus, 'configured');
|
|
expect($configured->label)->toBe('Configured');
|
|
expect($configured->color)->toBe('success');
|
|
|
|
$manual = BadgeCatalog::spec(BadgeDomain::TenantRbacStatus, 'manual_assignment_required');
|
|
expect($manual->label)->toBe('Manual assignment required');
|
|
expect($manual->color)->toBe('warning');
|
|
|
|
$notConfigured = BadgeCatalog::spec(BadgeDomain::TenantRbacStatus, 'not_configured');
|
|
expect($notConfigured->label)->toBe('Not configured');
|
|
expect($notConfigured->color)->toBe('gray');
|
|
});
|
|
|
|
it('maps tenant permission status values to canonical badge semantics', function (): void {
|
|
$granted = BadgeCatalog::spec(BadgeDomain::TenantPermissionStatus, 'granted');
|
|
expect($granted->label)->toBe('Granted');
|
|
expect($granted->color)->toBe('success');
|
|
|
|
$missing = BadgeCatalog::spec(BadgeDomain::TenantPermissionStatus, 'missing');
|
|
expect($missing->label)->toBe('Missing');
|
|
expect($missing->color)->toBe('warning');
|
|
|
|
$error = BadgeCatalog::spec(BadgeDomain::TenantPermissionStatus, 'error');
|
|
expect($error->label)->toBe('Error');
|
|
expect($error->color)->toBe('danger');
|
|
});
|