actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $component = Livewire::test(ListEntraGroupSyncRuns::class); $user->tenants()->detach($tenant->getKey()); app(\App\Services\Auth\CapabilityResolver::class)->clearCache(); expect($component->instance()->getAction([['name' => 'sync_groups']]))->toBeNull(); Queue::assertNothingPushed(); }); it('does not expose a sync action for readonly members', function () { [$user, $tenant] = createUserWithTenant(role: 'readonly'); $this->actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $component = Livewire::test(ListEntraGroupSyncRuns::class); expect($component->instance()->getAction([['name' => 'sync_groups']]))->toBeNull(); Queue::assertNothingPushed(); }); it('does not expose a sync action for owner members', function () { [$user, $tenant] = createUserWithTenant(role: 'owner'); $this->actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $component = Livewire::test(ListEntraGroupSyncRuns::class); expect($component->instance()->getAction([['name' => 'sync_groups']]))->toBeNull(); Queue::assertNothingPushed(); }); });