<?php

declare(strict_types=1);

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

it('maps audit outcomes to canonical badge semantics', function (): void {
    $success = BadgeCatalog::spec(BadgeDomain::AuditOutcome, 'success');
    expect($success->label)->toBe('Success');
    expect($success->color)->toBe('success');

    $failed = BadgeCatalog::spec(BadgeDomain::AuditOutcome, 'failed');
    expect($failed->label)->toBe('Failed');
    expect($failed->color)->toBe('danger');

    $blocked = BadgeCatalog::spec(BadgeDomain::AuditOutcome, 'blocked');
    expect($blocked->label)->toBe('Blocked');
    expect($blocked->color)->toBe('warning');
});

it('maps audit actor types to canonical badge semantics', function (): void {
    $human = BadgeCatalog::spec(BadgeDomain::AuditActorType, 'human');
    expect($human->label)->toBe('Human');
    expect($human->color)->toBe('info');

    $scheduled = BadgeCatalog::spec(BadgeDomain::AuditActorType, 'scheduled');
    expect($scheduled->label)->toBe('Scheduled job');
    expect($scheduled->color)->toBe('warning');

    $platform = BadgeCatalog::spec(BadgeDomain::AuditActorType, 'platform');
    expect($platform->label)->toBe('Platform');
    expect($platform->color)->toBe('gray');
});
