TenantAtlas/apps/platform/tests/Unit/Tenants/AdminSurfaceScopeTest.php
ahmido b159dacd36 feat: clean up legacy tenant environment context (#372)
## Summary
- remove legacy tenant-scoped routing and middleware paths in favor of the current environment/workspace context flow
- update Filament pages and resources to use the cleaned-up admin surface and environment filter context
- add the related spec 317 artifacts and targeted tests for environment filter state and legacy context cleanup

## Testing
- not run as part of this commit/push/PR workflow

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #372
2026-05-16 18:25:36 +00:00

33 lines
2.2 KiB
PHP

<?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],
'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],
]);