<?php

declare(strict_types=1);

use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeDomain;

it('maps inventory coverage states to shared badge specs', function (): void {
    expect(BadgeCatalog::spec(BadgeDomain::InventoryCoverageState, 'succeeded'))
        ->label->toBe('Succeeded')
        ->color->toBe('success')
        ->icon->toBe('heroicon-m-check-circle');

    expect(BadgeCatalog::spec(BadgeDomain::InventoryCoverageState, 'failed'))
        ->label->toBe('Failed')
        ->color->toBe('danger')
        ->icon->toBe('heroicon-m-x-circle');

    expect(BadgeCatalog::spec(BadgeDomain::InventoryCoverageState, 'skipped'))
        ->label->toBe('Skipped')
        ->color->toBe('warning')
        ->icon->toBe('heroicon-m-minus-circle');

    expect(BadgeCatalog::spec(BadgeDomain::InventoryCoverageState, 'unknown'))
        ->label->toBe('Unknown')
        ->color->toBe('gray')
        ->icon->toBe('heroicon-m-question-mark-circle');
});

it('falls back safely for unsupported inventory coverage states', function (): void {
    expect(BadgeCatalog::spec(BadgeDomain::InventoryCoverageState, 'not-real'))
        ->label->toBe('Unknown')
        ->color->toBe('gray');
});
