## Summary
- add the full Spec 195 residual action-surface design package under `specs/195-action-surface-closure`
- implement residual surface inventory and validator enforcement for uncatalogued system and special Filament pages
- add focused regression coverage for residual guards, system directory pages, managed-tenants landing, and readonly register-tenant / tenant-dashboard access
- fix the system workspace detail surface by loading tenant route keys and disabling lazy system database notifications to avoid the Livewire 404 on `/system/directory/workspaces/{workspace}`
## Testing
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/System/Spec195/SystemDirectoryResidualSurfaceTest.php tests/Feature/Filament/DatabaseNotificationsPollingTest.php`
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`
## Notes
- branch: `195-action-surface-closure`
- target: `dev`
- no new assets, migrations, or provider-registration changes
Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #230
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
use App\Filament\Pages\Tenancy\RegisterTenant;
|
|
use Filament\Facades\Filament;
|
|
use Livewire\Livewire;
|
|
|
|
describe('Register tenant page authorization', function () {
|
|
it('is not visible for readonly members', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user);
|
|
$tenant->makeCurrent();
|
|
|
|
Filament::setCurrentPanel(Filament::getPanel('tenant'));
|
|
|
|
expect(RegisterTenant::canView())->toBeFalse();
|
|
|
|
Filament::setCurrentPanel(null);
|
|
});
|
|
|
|
it('is visible for owner members', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
|
|
$this->actingAs($user);
|
|
$tenant->makeCurrent();
|
|
|
|
Filament::setCurrentPanel(Filament::getPanel('tenant'));
|
|
|
|
expect(RegisterTenant::canView())->toBeTrue();
|
|
|
|
Filament::setCurrentPanel(null);
|
|
});
|
|
|
|
it('rejects readonly members when they try to mount the register-tenant page', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user);
|
|
$tenant->makeCurrent();
|
|
|
|
Filament::setCurrentPanel(Filament::getPanel('tenant'));
|
|
|
|
Livewire::actingAs($user)
|
|
->test(RegisterTenant::class)
|
|
->assertNotFound();
|
|
|
|
Filament::setCurrentPanel(null);
|
|
});
|
|
});
|