actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $policy = Policy::factory()->for($tenant)->create(); $this->mock(VersionService::class, function (MockInterface $mock) { $mock->shouldReceive('captureFromGraph')->never(); }); Livewire::test(ViewPolicy::class, ['record' => $policy->getRouteKey()]) ->callAction('capture_snapshot', data: [ 'include_assignments' => true, 'include_scope_tags' => true, ]); Queue::assertPushed(CapturePolicySnapshotJob::class); $run = BulkOperationRun::query() ->where('tenant_id', $tenant->id) ->where('resource', 'policies') ->where('action', 'capture_snapshot') ->latest('id') ->first(); expect($run)->not->toBeNull(); expect($run->item_ids)->toBe([(string) $policy->getKey()]); });