create(); $otherTenant = Tenant::factory()->create(); [$user] = createUserWithTenant($otherTenant, role: 'owner'); $this->actingAs($user) ->get(BackupSetResource::getUrl('index', tenant: $tenant)) ->assertStatus(404); }); test('members without capability see BackupSet actions disabled with standard tooltip and cannot execute', function () { $tenant = Tenant::factory()->create(); [$user] = createUserWithTenant($tenant, role: 'readonly'); $backupSet = BackupSet::factory()->create([ 'tenant_id' => $tenant->getKey(), 'status' => 'completed', 'deleted_at' => null, ]); Filament::setTenant($tenant, true); Livewire::actingAs($user) ->test(ListBackupSets::class) ->assertTableActionDisabled('archive', $backupSet) ->assertTableActionExists('archive', fn ($action): bool => $action->getTooltip() === UiTooltips::insufficientPermission(), $backupSet) ->callTableAction('archive', $backupSet); expect($backupSet->fresh()->trashed())->toBeFalse(); }); test('members with capability can execute BackupSet actions', function () { $tenant = Tenant::factory()->create(); [$user] = createUserWithTenant($tenant, role: 'owner'); $backupSet = BackupSet::factory()->create([ 'tenant_id' => $tenant->getKey(), 'status' => 'completed', 'deleted_at' => null, ]); Filament::setTenant($tenant, true); Livewire::actingAs($user) ->test(ListBackupSets::class) ->assertTableActionEnabled('archive', $backupSet) ->callTableAction('archive', $backupSet); expect($backupSet->fresh()->trashed())->toBeTrue(); });