<?php

declare(strict_types=1);

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

it('maps restore preview decisions to canonical badge semantics', function (): void {
    $created = BadgeCatalog::spec(BadgeDomain::RestorePreviewDecision, 'created');
    expect($created->label)->toBe('Created');
    expect($created->color)->toBe('success');

    $mappedExisting = BadgeCatalog::spec(BadgeDomain::RestorePreviewDecision, 'mapped_existing');
    expect($mappedExisting->label)->toBe('Mapped existing');
    expect($mappedExisting->color)->toBe('info');

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

it('maps restore results statuses to canonical badge semantics', function (): void {
    $applied = BadgeCatalog::spec(BadgeDomain::RestoreResultStatus, 'applied');
    expect($applied->label)->toBe('Applied');
    expect($applied->color)->toBe('success');

    $dryRun = BadgeCatalog::spec(BadgeDomain::RestoreResultStatus, 'dry_run');
    expect($dryRun->label)->toBe('Dry run');
    expect($dryRun->color)->toBe('info');

    $manualRequired = BadgeCatalog::spec(BadgeDomain::RestoreResultStatus, 'manual_required');
    expect($manualRequired->label)->toBe('Manual required');
    expect($manualRequired->color)->toBe('warning');

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