<?php

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;

uses(RefreshDatabase::class);

beforeEach(function (): void {
    Http::preventStrayRequests();
});

it('returns 404 for legacy inventory and directory run pages', function (): void {
    [$user, $tenant] = createUserWithTenant(role: 'owner');

    $legacyUrls = [
        "/admin/t/{$tenant->external_id}/inventory-sync-runs",
        "/admin/t/{$tenant->external_id}/inventory-sync-runs/1",
        "/admin/t/{$tenant->external_id}/entra-group-sync-runs",
        "/admin/t/{$tenant->external_id}/entra-group-sync-runs/1",
    ];

    foreach ($legacyUrls as $url) {
        $this->actingAs($user)
            ->get($url)
            ->assertNotFound();
    }
});
