create(); [$user, $tenant] = createUserWithTenant(tenant: $tenant, role: 'owner'); $connection = ProviderConnection::factory()->verifiedHealthy()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'managed_environment_id' => (int) $tenant->getKey(), 'provider' => 'microsoft', ]); $resolvedProviderBlocker = OperationRun::factory()->forTenant($tenant)->create([ 'type' => 'provider.connection.check', 'status' => OperationRunStatus::Completed->value, 'outcome' => OperationRunOutcome::Blocked->value, 'initiator_name' => 'Resolved provider blocker', 'completed_at' => now()->subHour(), 'context' => [ 'provider' => 'microsoft', 'provider_connection_id' => (int) $connection->getKey(), ], ]); $currentPolicyFailure = OperationRun::factory()->forTenant($tenant)->create([ 'type' => 'policy.sync', 'status' => OperationRunStatus::Completed->value, 'outcome' => OperationRunOutcome::Failed->value, 'initiator_name' => 'Current policy failure', 'completed_at' => now()->subMinutes(30), ]); $this->actingAs($user); setAdminPanelContext($tenant); session()->put(WorkspaceContext::SESSION_KEY, (int) $tenant->workspace_id); Livewire::actingAs($user) ->test(Operations::class) ->filterTable('managed_environment_id', (string) $tenant->getKey()) ->set('activeTab', OperationRun::PROBLEM_CLASS_TERMINAL_FOLLOW_UP) ->assertCanSeeTableRecords([$currentPolicyFailure]) ->assertCanNotSeeTableRecords([$resolvedProviderBlocker]); }); it('shows dashboard operation attention only for current actionability in Spec367', function (): void { $tenant = ManagedEnvironment::factory()->create(); [$user, $tenant] = createUserWithTenant(tenant: $tenant, role: 'owner'); $connection = ProviderConnection::factory()->verifiedHealthy()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'managed_environment_id' => (int) $tenant->getKey(), 'provider' => 'microsoft', ]); OperationRun::factory()->forTenant($tenant)->create([ 'type' => 'provider.connection.check', 'status' => OperationRunStatus::Completed->value, 'outcome' => OperationRunOutcome::Blocked->value, 'completed_at' => now()->subHour(), 'context' => [ 'provider' => 'microsoft', 'provider_connection_id' => (int) $connection->getKey(), ], ]); $this->actingAs($user); setAdminPanelContext($tenant); session()->put(WorkspaceContext::SESSION_KEY, (int) $tenant->workspace_id); Livewire::actingAs($user) ->test(NeedsAttention::class) ->assertDontSee('Operations need current follow-up'); OperationRun::factory()->forTenant($tenant)->create([ 'type' => 'policy.sync', 'status' => OperationRunStatus::Completed->value, 'outcome' => OperationRunOutcome::Failed->value, 'completed_at' => now()->subMinutes(30), ]); Livewire::actingAs($user) ->test(NeedsAttention::class) ->assertSee('Operations need current follow-up') ->assertSee('Open current follow-up'); });