<?php

declare(strict_types=1);

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

it('maps environment review lifecycle values to canonical badge semantics', function (): void {
    expect(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewStatus, 'draft')->label)->toBe('Draft')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewStatus, 'ready')->color)->toBe('info')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewStatus, 'published')->color)->toBe('success')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewStatus, 'archived')->color)->toBe('gray')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewStatus, 'failed')->color)->toBe('danger');
});

it('maps environment review completeness values to canonical badge semantics', function (): void {
    expect(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewCompleteness, 'complete')->label)->toBe('Review inputs ready')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewCompleteness, 'partial')->color)->toBe('warning')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewCompleteness, 'missing')->label)->toBe('Review input pending')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewCompleteness, 'missing')->color)->toBe('info')
        ->and(BadgeCatalog::spec(BadgeDomain::EnvironmentReviewCompleteness, 'stale')->label)->toBe('Refresh review inputs');
});

it('maps publication-readiness truth badges for environment reviews', function (): void {
    expect(BadgeCatalog::spec(BadgeDomain::GovernanceArtifactPublicationReadiness, 'internal_only')->label)->toBe('Internal only')
        ->and(BadgeCatalog::spec(BadgeDomain::GovernanceArtifactPublicationReadiness, 'blocked')->label)->toBe('Publication blocked')
        ->and(BadgeCatalog::spec(BadgeDomain::GovernanceArtifactPublicationReadiness, 'publishable')->label)->toBe('Publishable');
});
