TenantAtlas/apps/platform/tests/Unit/Badges/TenantBadgesTest.php
ahmido be314c577f Spec 400: rebuild Tenantial homepage visuals (#387)
## Summary
- rebuild the public Tenantial homepage around an evidence-first Microsoft tenant governance narrative
- replace the old hero visual with a new static dashboard preview and add dedicated Trust Bar and Feature Pillars sections
- update the shared public shell, navigation, footer, dark design tokens, assets, and homepage content to match the new brand direction
- align website smoke coverage and Spec 400 artifacts with the rebuilt homepage

## Testing
- not run in this pass
- updated website smoke specs under apps/website/tests/smoke

## Note
- `website-dev` was pushed to `origin` so the requested PR base exists remotely
- the remote `website-dev` branch is an ancestor of `origin/dev`, so this PR may also show upstream `dev` history relative to that base

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #387
2026-05-18 14:38:11 +00:00

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');
});