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