set('tenantpilot.onboarding.credentials_required', false); Bus::fake(); [$user, $portfolioTenant] = createUserWithTenant(role: 'owner'); $this->actingAs($user); $tenantGuid = fake()->uuid(); $component = Livewire::withQueryParams([ 'tenant' => (string) $portfolioTenant->external_id, ])->test(TenantOnboardingWizard::class) ->goToNextWizardStep() ->fillForm([ 'name' => 'Acme', 'environment' => 'other', 'tenant_id' => $tenantGuid, 'domain' => 'acme.example', ], 'form') ->goToNextWizardStep(); $component->call('enqueueVerification'); expect(OperationRun::query()->where('type', 'tenant.rbac.verify')->count())->toBe(1); Bus::assertDispatched(TenantOnboardingVerifyJob::class, 1); $component->call('enqueueVerification'); expect(OperationRun::query()->where('type', 'tenant.rbac.verify')->count())->toBe(1); Bus::assertDispatched(TenantOnboardingVerifyJob::class, 1); });