TenantAtlas/apps/platform/tests/Feature/Badges/SystemHealthBadgeSemanticsTest.php
Ahmed Darrazi de90f414fe
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m25s
feat: improve system panel branding and auth experience
2026-06-22 01:04:34 +02: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 a Ready success badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::SystemHealth, 'ok');
expect($spec->label)->toBe('Ready');
expect($spec->color)->toBe('success');
expect($spec->icon)->toBe('heroicon-m-check-circle');
});
it('maps system health warn to a Needs attention warning badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::SystemHealth, 'warn');
expect($spec->label)->toBe('Needs attention');
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');
});