<?php

declare(strict_types=1);

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

it('maps inventory sync run status values to canonical badge semantics', function (): void {
    $pending = BadgeCatalog::spec(BadgeDomain::InventorySyncRunStatus, 'pending');
    expect($pending->label)->toBe('Pending');
    expect($pending->color)->toBe('gray');

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

    $success = BadgeCatalog::spec(BadgeDomain::InventorySyncRunStatus, 'success');
    expect($success->label)->toBe('Success');
    expect($success->color)->toBe('success');

    $partial = BadgeCatalog::spec(BadgeDomain::InventorySyncRunStatus, 'partial');
    expect($partial->label)->toBe('Partial');
    expect($partial->color)->toBe('warning');

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

    $skipped = BadgeCatalog::spec(BadgeDomain::InventorySyncRunStatus, 'skipped');
    expect($skipped->label)->toBe('Skipped');
    expect($skipped->color)->toBe('gray');
});

it('maps backup schedule run status values to canonical badge semantics', function (): void {
    $running = BadgeCatalog::spec(BadgeDomain::BackupScheduleRunStatus, 'running');
    expect($running->label)->toBe('Running');
    expect($running->color)->toBe('info');

    $success = BadgeCatalog::spec(BadgeDomain::BackupScheduleRunStatus, 'success');
    expect($success->label)->toBe('Success');
    expect($success->color)->toBe('success');

    $partial = BadgeCatalog::spec(BadgeDomain::BackupScheduleRunStatus, 'partial');
    expect($partial->label)->toBe('Partial');
    expect($partial->color)->toBe('warning');

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

    $canceled = BadgeCatalog::spec(BadgeDomain::BackupScheduleRunStatus, 'canceled');
    expect($canceled->label)->toBe('Canceled');
    expect($canceled->color)->toBe('gray');

    $skipped = BadgeCatalog::spec(BadgeDomain::BackupScheduleRunStatus, 'skipped');
    expect($skipped->label)->toBe('Skipped');
    expect($skipped->color)->toBe('gray');
});
