<?php

declare(strict_types=1);

use App\Services\Operations\OperationLifecyclePolicyValidator;

it('accepts the current lifecycle timing configuration for covered operation types', function (): void {
    $result = app(OperationLifecyclePolicyValidator::class)->validate();

    expect($result['valid'])->toBeTrue()
        ->and($result['errors'])->toBe([]);
});

it('detects retry_after mismatches for covered lifecycle policy entries', function (): void {
    config()->set('queue.connections.database.retry_after', 200);

    $result = app(OperationLifecyclePolicyValidator::class)->validate();

    expect($result['valid'])->toBeFalse()
        ->and(collect($result['errors'])->join(' '))->toContain('retry_after');
});
