set('tenantpilot.onboarding.credentials_required', false); config()->set('intune_permissions.permissions', [[ 'key' => 'DeviceManagementApps.Read.All', 'type' => 'application', 'description' => 'Read apps', 'features' => ['apps'], ]]); [$user, $tenant] = createUserWithTenant(role: 'owner'); $this->actingAs($user); ProviderConnection::query()->create([ 'tenant_id' => (int) $tenant->getKey(), 'provider' => 'microsoft', 'entra_tenant_id' => (string) $tenant->tenant_id, 'display_name' => 'Microsoft Graph', 'is_default' => true, 'status' => 'connected', 'health_status' => 'ok', 'scopes_granted' => [], 'metadata' => [], ]); TenantPermission::create([ 'tenant_id' => $tenant->getKey(), 'permission_key' => 'DeviceManagementApps.Read.All', 'status' => 'granted', 'details' => ['source' => 'test'], 'last_checked_at' => now(), ]); OperationRun::query()->create([ 'tenant_id' => $tenant->getKey(), 'user_id' => $user->getKey(), 'initiator_name' => $user->name, 'type' => 'tenant.rbac.verify', 'status' => 'completed', 'outcome' => 'succeeded', 'run_identity_hash' => 'test', 'summary_counts' => [], 'failure_summary' => [], 'context' => [], ]); TenantOnboardingSession::factory()->create([ 'tenant_id' => $tenant->getKey(), 'created_by_user_id' => $user->getKey(), 'status' => 'active', 'current_step' => 'verification', 'payload' => [ 'tenant_id' => $tenant->tenant_id, 'environment' => $tenant->environment, 'name' => $tenant->name, ], ]); Livewire::withQueryParams([ 'tenant' => (string) $tenant->external_id, ]) ->test(TenantOnboardingWizard::class) ->assertSee('Ready:'); });