24 lines
624 B
PHP
24 lines
624 B
PHP
<?php
|
|
|
|
use App\Filament\Pages\Tenancy\RegisterTenant;
|
|
|
|
describe('Register tenant page authorization', function () {
|
|
it('is not visible for readonly members', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user);
|
|
$tenant->makeCurrent();
|
|
|
|
expect(RegisterTenant::canView())->toBeFalse();
|
|
});
|
|
|
|
it('is visible for owner members', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
|
|
$this->actingAs($user);
|
|
$tenant->makeCurrent();
|
|
|
|
expect(RegisterTenant::canView())->toBeTrue();
|
|
});
|
|
});
|