<?php

use App\Jobs\PruneOldOperationRunsJob;
use Illuminate\Console\Scheduling\Schedule;

it('schedules pruning job daily without overlapping', function () {
    /** @var Schedule $schedule */
    $schedule = app(Schedule::class);

    $event = collect($schedule->events())
        ->first(fn ($event) => ($event->description ?? null) === PruneOldOperationRunsJob::class);

    expect($event)->not->toBeNull();
    expect($event->withoutOverlapping)->toBeTrue();
});
