actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $report = json_decode( (string) file_get_contents(base_path('specs/074-verification-checklist/contracts/examples/fail.json')), true, 512, JSON_THROW_ON_ERROR, ); $run = OperationRun::factory()->create([ 'tenant_id' => (int) $tenant->getKey(), 'user_id' => (int) $user->getKey(), 'type' => 'provider.connection.check', 'status' => 'completed', 'outcome' => 'failed', 'context' => [ 'verification_report' => $report, ], ]); assertNoOutboundHttp(function () use ($run): void { $component = Livewire::test(ViewOperationRun::class, ['record' => $run->getRouteKey()]) ->assertSee('Verification report') ->assertSee('Blocked') ->assertSee('Token acquisition works'); $component ->call('$refresh') ->assertSee('Token acquisition works'); }); Bus::assertNothingDispatched(); }); it('renders onboarding verify surfaces DB-only (no outbound HTTP, no job/queue dispatch)', function (): void { Bus::fake(); Queue::fake(); $workspace = Workspace::factory()->create(); $user = User::factory()->create(); WorkspaceMembership::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'user_id' => (int) $user->getKey(), 'role' => 'owner', ]); session()->put(WorkspaceContext::SESSION_KEY, (int) $workspace->getKey()); $tenant = Tenant::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'status' => Tenant::STATUS_ONBOARDING, ]); $connection = ProviderConnection::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'tenant_id' => (int) $tenant->getKey(), 'is_default' => true, ]); $report = VerificationReportWriter::build('provider.connection.check', [ [ 'key' => 'onboarding_check', 'title' => 'Onboarding check', 'status' => 'fail', 'severity' => 'high', 'blocking' => false, 'reason_code' => 'missing_configuration', 'message' => 'Setup missing.', 'evidence' => [], 'next_steps' => [], ], ]); $run = OperationRun::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'tenant_id' => (int) $tenant->getKey(), 'type' => 'provider.connection.check', 'status' => 'completed', 'outcome' => 'failed', 'context' => [ 'provider_connection_id' => (int) $connection->getKey(), 'verification_report' => $report, ], ]); TenantOnboardingSession::query()->create([ 'workspace_id' => (int) $workspace->getKey(), 'tenant_id' => (int) $tenant->getKey(), 'entra_tenant_id' => (string) $tenant->tenant_id, 'current_step' => 'verify', 'state' => [ 'provider_connection_id' => (int) $connection->getKey(), 'verification_operation_run_id' => (int) $run->getKey(), ], 'started_by_user_id' => (int) $user->getKey(), 'updated_by_user_id' => (int) $user->getKey(), ]); assertNoOutboundHttp(function () use ($user): void { $this->actingAs($user) ->get('/admin/onboarding') ->assertSuccessful() ->assertSee('Onboarding check'); }); Bus::assertNothingDispatched(); Queue::assertNothingPushed(); });