<?php

declare(strict_types=1);

use App\Support\Navigation\AdminSurfaceScope;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

it('classifies in-scope admin routes into canonical page categories', function (string $path, AdminSurfaceScope $expected): void {
    expect(AdminSurfaceScope::fromPath($path))->toBe($expected);
})->with([
    'workspace overview' => ['/admin', AdminSurfaceScope::WorkspaceWideSurface],
    'workspace chooser exception' => ['/admin/choose-workspace', AdminSurfaceScope::WorkspaceChooserException],
    'tenant chooser' => ['/admin/choose-environment', AdminSurfaceScope::WorkspaceScoped],
    'retired tenant resource detail' => ['/admin/tenants/tenant-123', AdminSurfaceScope::WorkspaceScoped],
    'retired tenant panel route' => ['/admin/t/tenant-123', AdminSurfaceScope::WorkspaceScoped],
    'workspace environment detail' => ['/admin/workspaces/acme/environments/tenant-123', AdminSurfaceScope::EnvironmentBound],
    'baseline compare environment route' => ['/admin/workspaces/acme/environments/tenant-123/baseline-compare', AdminSurfaceScope::EnvironmentBound],
    'tenant scoped evidence detail' => ['/admin/evidence/123', AdminSurfaceScope::EnvironmentScopedEvidence],
    'evidence overview' => ['/admin/evidence/overview', AdminSurfaceScope::WorkspaceWideSurface],
    'customer review workspace' => ['/admin/reviews/workspace', AdminSurfaceScope::WorkspaceWideSurface],
    'review register' => ['/admin/reviews', AdminSurfaceScope::WorkspaceWideSurface],
    'governance decisions' => ['/admin/governance/decisions', AdminSurfaceScope::WorkspaceWideSurface],
    'alerts' => ['/admin/alerts', AdminSurfaceScope::WorkspaceWideSurface],
    'provider connections' => ['/admin/provider-connections', AdminSurfaceScope::WorkspaceWideSurface],
    'workspace home overview' => ['/admin/workspaces/acme/overview', AdminSurfaceScope::WorkspaceWideSurface],
    'onboarding index' => ['/admin/onboarding', AdminSurfaceScope::OnboardingWorkflow],
    'onboarding draft' => ['/admin/onboarding/42', AdminSurfaceScope::OnboardingWorkflow],
    'operations index' => ['/admin/workspaces/acme/operations', AdminSurfaceScope::WorkspaceWideSurface],
    'retired operation run detail' => ['/admin/operations/44', AdminSurfaceScope::WorkspaceScoped],
    'operation run detail' => ['/admin/workspaces/acme/operations/44', AdminSurfaceScope::CanonicalWorkspaceRecordViewer],
]);
