TenantAtlas/tests/Feature/Badges/SystemHealthBadgeSemanticsTest.php
Ahmed Darrazi 875528cd35 feat(114): system console control tower
Implements Spec 114 System Console Control Tower pages, widgets, triage actions, directory views, and enterprise polish (badges, repair workspace owners table, health indicator).
2026-02-27 17:28:09 +01:00

38 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeDomain;
it('maps system health ok to an OK success badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::SystemHealth, 'ok');
expect($spec->label)->toBe('OK');
expect($spec->color)->toBe('success');
expect($spec->icon)->toBe('heroicon-m-check-circle');
});
it('maps system health warn to a Warn warning badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::SystemHealth, 'warn');
expect($spec->label)->toBe('Warn');
expect($spec->color)->toBe('warning');
expect($spec->icon)->toBe('heroicon-m-exclamation-triangle');
});
it('maps system health critical to a Critical danger badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::SystemHealth, 'critical');
expect($spec->label)->toBe('Critical');
expect($spec->color)->toBe('danger');
expect($spec->icon)->toBe('heroicon-m-x-circle');
});
it('maps unknown system health states to an Unknown badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::SystemHealth, 'not-a-state');
expect($spec->label)->toBe('Unknown');
expect($spec->color)->toBe('gray');
});