set('tenantpilot.onboarding.credentials_required', true); 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() ->fillForm([ 'app_client_id' => fake()->uuid(), 'app_client_secret' => 'super-secret', 'acknowledge_credentials' => true, ], 'form') ->goToNextWizardStep() ->goToNextWizardStep(); $component->call('enqueueConnectionCheck'); expect(OperationRun::query()->where('type', 'provider.connection.check')->count())->toBe(1); Bus::assertDispatched(ProviderConnectionHealthCheckJob::class, 1); $component->call('enqueueConnectionCheck'); expect(OperationRun::query()->where('type', 'provider.connection.check')->count())->toBe(1); Bus::assertDispatched(ProviderConnectionHealthCheckJob::class, 1); });