<?php

declare(strict_types=1);

use App\Support\OpsUx\OperationStatusNormalizer;

test('operation status normalizer maps queued and running', function (): void {
    expect(OperationStatusNormalizer::toUxStatus('queued', 'pending'))->toBe('queued')
        ->and(OperationStatusNormalizer::toUxStatus('running', 'pending'))->toBe('running');
});

test('operation status normalizer maps terminal outcomes', function (): void {
    expect(OperationStatusNormalizer::toUxStatus('completed', 'succeeded'))->toBe('succeeded')
        ->and(OperationStatusNormalizer::toUxStatus('completed', 'partially_succeeded'))->toBe('partial')
        ->and(OperationStatusNormalizer::toUxStatus('completed', 'failed'))->toBe('failed')
        ->and(OperationStatusNormalizer::toUxStatus('failed', 'pending'))->toBe('failed');
});
