<?php

declare(strict_types=1);

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

it('maps verification check status values to canonical badge semantics', function (): void {
    $pass = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'pass');
    expect($pass->label)->toBe('Pass');
    expect($pass->color)->toBe('success');

    $fail = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'fail');
    expect($fail->label)->toBe('Fail');
    expect($fail->color)->toBe('danger');

    $warn = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'warn');
    expect($warn->label)->toBe('Warn');
    expect($warn->color)->toBe('warning');

    $skip = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'skip');
    expect($skip->label)->toBe('Skipped');
    expect($skip->color)->toBe('gray');

    $running = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'running');
    expect($running->label)->toBe('Running');
    expect($running->color)->toBe('info');
});

it('maps verification check severity values to canonical badge semantics', function (): void {
    $info = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'info');
    expect($info->label)->toBe('Info');
    expect($info->color)->toBe('gray');

    $low = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'low');
    expect($low->label)->toBe('Low');
    expect($low->color)->toBe('info');

    $medium = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'medium');
    expect($medium->label)->toBe('Medium');
    expect($medium->color)->toBe('warning');

    $high = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'high');
    expect($high->label)->toBe('High');
    expect($high->color)->toBe('danger');

    $critical = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'critical');
    expect($critical->label)->toBe('Critical');
    expect($critical->color)->toBe('danger');
});

it('maps verification report overall values to canonical badge semantics', function (): void {
    $ready = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'ready');
    expect($ready->label)->toBe('Ready');
    expect($ready->color)->toBe('success');

    $needsAttention = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'needs_attention');
    expect($needsAttention->label)->toBe('Needs attention');
    expect($needsAttention->color)->toBe('warning');

    $blocked = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'blocked');
    expect($blocked->label)->toBe('Blocked');
    expect($blocked->color)->toBe('danger');

    $running = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'running');
    expect($running->label)->toBe('Running');
    expect($running->color)->toBe('info');
});
