Implements Spec 083 (Canonical Required Permissions manage surface hardening + issues-first UX).
Highlights:
- Enforces canonical route: /admin/tenants/{tenant}/required-permissions
- Legacy tenant-plane URL /admin/t/{tenant}/required-permissions stays non-existent (404)
- Deny-as-not-found (404) for non-workspace members and non-tenant-entitled users
- Strict tenant resolution (no cross-plane fallback)
- DB-only render (no external provider calls on page load)
- Issues-first layout + canonical next-step links (re-run verification -> /admin/onboarding)
- Freshness/stale detection (missing or >30 days -> warning)
Tests (Sail):
- vendor/bin/sail artisan test --compact tests/Feature/RequiredPermissions
- vendor/bin/sail artisan test --compact tests/Unit/TenantRequiredPermissionsFreshnessTest.php tests/Unit/TenantRequiredPermissionsOverallStatusTest.php
Notes:
- Filament v5 / Livewire v4 compliant.
- No destructive actions added in this spec; link-only CTAs.
Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box>
Reviewed-on: #101
26 lines
1.0 KiB
PHP
26 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
it('renders re-run verification and next-step links using canonical manage surfaces only', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user)
|
|
->get("/admin/tenants/{$tenant->external_id}/required-permissions")
|
|
->assertSuccessful()
|
|
->assertSee('Re-run verification')
|
|
->assertSee('/admin/onboarding', false)
|
|
->assertDontSee('/admin/t/', false);
|
|
});
|
|
|
|
it('renders sections in summary-issues-passed-technical order and keeps technical details collapsed by default', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user)
|
|
->get("/admin/tenants/{$tenant->external_id}/required-permissions")
|
|
->assertSuccessful()
|
|
->assertSeeInOrder(['Summary', 'Issues', 'Passed', 'Technical details'])
|
|
->assertSee('<details data-testid="technical-details"', false)
|
|
->assertDontSee('data-testid="technical-details" open', false);
|
|
});
|