<?php

declare(strict_types=1);

use App\Models\EnhanceJob;
use App\Models\User;

it('allows moderators to browse enhance jobs in moderation', function (): void {
    $moderator = User::factory()->create(['role' => 'moderator']);
    $creator = User::factory()->create();

    $job = EnhanceJob::query()->create([
        'user_id' => $creator->id,
        'status' => EnhanceJob::STATUS_COMPLETED,
        'engine' => EnhanceJob::ENGINE_STUB,
        'mode' => 'standard',
        'scale' => 2,
    ]);

    $this->actingAs($moderator)
        ->get(route('admin.enhance.index'))
        ->assertOk()
        ->assertSee((string) $job->id);
});

it('blocks regular users from the moderation enhance surface', function (): void {
    $user = User::factory()->create();

    $this->actingAs($user)
        ->get(route('admin.enhance.index'))
        ->assertForbidden();
});