@skyhook-io/radar-app 1.22.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/src/App.tsx +131 -38
- package/src/RadarApp.basename.test.tsx +177 -0
- package/src/RadarApp.settings.test.tsx +33 -0
- package/src/RadarApp.tsx +5 -0
- package/src/api/agentSandbox.ts +259 -0
- package/src/api/client.autoPromConnect.test.tsx +43 -0
- package/src/api/client.metricsRelayCheck.test.tsx +134 -0
- package/src/api/client.ts +128 -25
- package/src/api/cloudInstallDiscover.test.tsx +76 -0
- package/src/api/diagnose.ts +4 -0
- package/src/api/kagent.test.ts +82 -0
- package/src/api/kagent.ts +230 -0
- package/src/api/prometheusCharts.ts +5 -0
- package/src/api/radarFeatures.test.ts +9 -0
- package/src/api/radarFeatures.ts +13 -0
- package/src/api/substrateWorkspace.test.ts +72 -0
- package/src/api/substrateWorkspace.ts +1394 -0
- package/src/api/vulnerabilities.ts +207 -9
- package/src/api/workloadSource.test.tsx +1172 -0
- package/src/api/workloadSource.ts +408 -0
- package/src/components/APIUnreachableBanner.test.tsx +19 -0
- package/src/components/APIUnreachableBanner.tsx +20 -0
- package/src/components/CloudConnectFlow.tsx +46 -7
- package/src/components/CloudFunnelButton.test.tsx +193 -7
- package/src/components/CloudFunnelButton.tsx +127 -32
- package/src/components/ConnectionErrorView.test.tsx +63 -2
- package/src/components/ConnectionErrorView.tsx +88 -68
- package/src/components/SelfManagedStart.tsx +12 -2
- package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
- package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
- package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
- package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
- package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
- package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
- package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
- package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
- package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
- package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
- package/src/components/agentsandbox/data.ts +135 -0
- package/src/components/agentsandbox/host.test.ts +27 -0
- package/src/components/agentsandbox/host.tsx +85 -0
- package/src/components/agentsandbox/labels.test.ts +42 -0
- package/src/components/agentsandbox/labels.ts +146 -0
- package/src/components/agentsandbox/listFilters.ts +85 -0
- package/src/components/agentsandbox/lists.ts +52 -0
- package/src/components/agentsandbox/routes.ts +23 -0
- package/src/components/agentsandbox/shared.tsx +321 -0
- package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
- package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
- package/src/components/agentsandbox/workspace.tsx +258 -0
- package/src/components/agentsandbox/workspaceRoute.ts +18 -0
- package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
- package/src/components/applications/ApplicationsView.tsx +156 -3
- package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
- package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
- package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
- package/src/components/audit/VulnerabilitiesView.tsx +639 -199
- package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
- package/src/components/cloudHints/CloudHintLink.tsx +29 -0
- package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
- package/src/components/cloudHints/cloudHints.test.ts +126 -0
- package/src/components/cloudHints/cloudHints.ts +131 -0
- package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
- package/src/components/cloudHints/cloudLinks.test.ts +52 -0
- package/src/components/cloudHints/cloudLinks.ts +31 -0
- package/src/components/cloudHints/hintStorage.ts +28 -0
- package/src/components/cnpg/CNPGView.tsx +4 -7
- package/src/components/diagnose/ActivityTurn.tsx +6 -4
- package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
- package/src/components/diagnose/AssessmentCard.tsx +1 -2
- package/src/components/diagnose/ContinueInAgentButton.test.tsx +7 -0
- package/src/components/diagnose/DiagnoseContext.tsx +7 -0
- package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
- package/src/components/diagnose/Home.test.tsx +6 -0
- package/src/components/diagnose/Home.tsx +10 -3
- package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +1 -1
- package/src/components/diagnose/InvestigationEvidencePane.tsx +19 -2
- package/src/components/diagnose/InvestigationFindingsFooter.test.tsx +413 -0
- package/src/components/diagnose/InvestigationView.tsx +120 -23
- package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
- package/src/components/diagnose/investigationEvidence/projection.test.ts +1 -1
- package/src/components/diagnose/investigationState.ts +9 -0
- package/src/components/diagnose/parts.test.tsx +11 -3
- package/src/components/diagnose/toolCallLabel.ts +3 -0
- package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
- package/src/components/home/ActivitySummary.tsx +3 -8
- package/src/components/home/ClusterHealthCard.tsx +91 -17
- package/src/components/home/ClusterHealthCard.utilization.test.tsx +187 -0
- package/src/components/home/HomeAgentBlock.tsx +2 -0
- package/src/components/home/HomeView.tsx +9 -29
- package/src/components/home/MCPSetupDialog.test.tsx +9 -0
- package/src/components/home/MCPSetupDialog.tsx +6 -2
- package/src/components/home/McpCloudLine.test.tsx +162 -0
- package/src/components/home/McpCloudLine.tsx +95 -0
- package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
- package/src/components/home/TopologyPreview.test.tsx +31 -30
- package/src/components/home/TopologyPreview.tsx +19 -28
- package/src/components/home/mcpToolCatalog.test.ts +10 -0
- package/src/components/home/mcpToolCatalog.ts +7 -7
- package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
- package/src/components/issues/IssuesPane.render.test.tsx +36 -1
- package/src/components/issues/IssuesPane.tsx +181 -23
- package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
- package/src/components/issues/SinceLastVisitRow.tsx +71 -0
- package/src/components/issues/sinceLastVisit.test.ts +266 -0
- package/src/components/issues/sinceLastVisit.ts +439 -0
- package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
- package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
- package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
- package/src/components/kagent/KagentAgentSessions.tsx +124 -0
- package/src/components/kagent/KagentDetailPage.tsx +106 -0
- package/src/components/kagent/KagentLists.tsx +412 -0
- package/src/components/kagent/KagentOverview.tsx +234 -0
- package/src/components/kagent/KagentPages.tsx +690 -0
- package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
- package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
- package/src/components/kagent/KagentSidebar.test.tsx +112 -0
- package/src/components/kagent/KagentView.tsx +109 -0
- package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
- package/src/components/kagent/host.tsx +144 -0
- package/src/components/kagent/routes.ts +31 -0
- package/src/components/kagent/shared.tsx +336 -0
- package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
- package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
- package/src/components/kagent/workspace.fixtures.ts +108 -0
- package/src/components/kagent/workspaceRoute.ts +18 -0
- package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
- package/src/components/resource/MetricsNotConnected.tsx +10 -7
- package/src/components/resource/PrometheusCharts.tsx +10 -1
- package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
- package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
- package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
- package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
- package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
- package/src/components/resources/ResourcesView.tsx +2 -6
- package/src/components/resources/renderers/JobAdmissionRenderers.tsx +5 -4
- package/src/components/resources/renderers/PodRenderer.tsx +8 -2
- package/src/components/resources/renderers/RolloutRenderer.tsx +4 -1
- package/src/components/resources/renderers/WorkloadRenderer.tsx +4 -1
- package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
- package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
- package/src/components/settings/SettingsDialog.tsx +84 -16
- package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
- package/src/components/settings/SubstrateSettings.test.tsx +131 -0
- package/src/components/settings/SubstrateSettings.tsx +544 -0
- package/src/components/settings/settings-state.test.ts +21 -3
- package/src/components/settings/settings-state.ts +13 -3
- package/src/components/share/ShareLinkButton.test.tsx +360 -0
- package/src/components/share/ShareLinkButton.tsx +391 -0
- package/src/components/share/openShareInCloud.test.ts +29 -0
- package/src/components/share/openShareInCloud.ts +10 -0
- package/src/components/share/shareLink.test.ts +129 -0
- package/src/components/share/shareLink.ts +175 -0
- package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
- package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
- package/src/components/substrate/SubstrateActorPage.tsx +384 -0
- package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
- package/src/components/substrate/SubstrateActors.tsx +612 -0
- package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
- package/src/components/substrate/SubstrateConnect.tsx +88 -0
- package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
- package/src/components/substrate/SubstrateOverview.tsx +575 -0
- package/src/components/substrate/SubstratePages.test.tsx +478 -0
- package/src/components/substrate/SubstratePool.test.tsx +462 -0
- package/src/components/substrate/SubstratePoolPage.tsx +95 -0
- package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
- package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
- package/src/components/substrate/SubstrateStateBar.tsx +63 -0
- package/src/components/substrate/SubstrateTemplates.tsx +376 -0
- package/src/components/substrate/SubstrateView.tsx +173 -0
- package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
- package/src/components/substrate/SubstrateWorkers.tsx +389 -0
- package/src/components/substrate/attention.ts +81 -0
- package/src/components/substrate/contextPin.tsx +69 -0
- package/src/components/substrate/host.tsx +83 -0
- package/src/components/substrate/kubectlTarget.test.tsx +77 -0
- package/src/components/substrate/readings.test.ts +484 -0
- package/src/components/substrate/readings.ts +997 -0
- package/src/components/substrate/routes.ts +103 -0
- package/src/components/substrate/shared.tsx +426 -0
- package/src/components/substrate/substrate.fixtures.ts +325 -0
- package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
- package/src/components/substrate/workspaceRoute.ts +23 -0
- package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
- package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
- package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
- package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
- package/src/components/traffic/TrafficFlowList.tsx +9 -5
- package/src/components/traffic/TrafficGraph.test.tsx +26 -0
- package/src/components/traffic/TrafficGraph.tsx +17 -14
- package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
- package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
- package/src/components/traffic/TrafficView.tsx +26 -56
- package/src/components/traffic/trafficFilters.test.ts +61 -1
- package/src/components/traffic/trafficFilters.ts +68 -8
- package/src/components/velero/VeleroOverview.tsx +2 -2
- package/src/components/velero/VeleroView.tsx +3 -6
- package/src/components/vulnerabilities/columns.tsx +132 -0
- package/src/components/vulnerabilities/filters.tsx +317 -0
- package/src/components/vulnerabilities/owner.test.ts +54 -0
- package/src/components/vulnerabilities/owner.tsx +163 -0
- package/src/components/vulnerabilities/parts.test.ts +126 -12
- package/src/components/vulnerabilities/parts.tsx +612 -52
- package/src/components/vulnerabilities/traffic.test.tsx +65 -0
- package/src/components/vulnerabilities/traffic.tsx +40 -0
- package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
- package/src/components/workload/WorkloadView.tsx +119 -14
- package/src/components/workload/WorkloadView.workloadSource.test.tsx +121 -0
- package/src/components/workspace/layout.tsx +13 -7
- package/src/components/workspace/sidebar.test.ts +48 -0
- package/src/components/workspace/sidebar.ts +73 -3
- package/src/components/workspace/table.ts +2 -1
- package/src/context/ConnectionContext.tsx +24 -5
- package/src/context/ConnectionProvider.connectionId.test.tsx +14 -0
- package/src/context/ConnectionProvider.handover.test.tsx +94 -0
- package/src/context/DiagnoseCustomization.tsx +20 -2
- package/src/contexts/RegistryAccessMode.test.tsx +51 -0
- package/src/contexts/RegistryAccessMode.tsx +25 -0
- package/src/hooks/useEventSource.test.tsx +275 -4
- package/src/hooks/useEventSource.ts +278 -51
- package/src/index.ts +1 -0
- package/src/integrations/resourceHost.ts +12 -6
- package/src/integrations/resourceHosts.test.tsx +27 -1
- package/src/integrations/resourceHosts.tsx +15 -7
- package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
- package/src/integrations/sidebarWorkspaces.ts +41 -0
- package/src/integrations/workspaceRoute.ts +1 -1
- package/src/integrations/workspaceRoutes.ts +7 -1
- package/src/integrations/workspaceScreens.tsx +6 -0
- package/src/utils/navigation.test.ts +1 -6
- package/src/utils/navigation.ts +9 -44
- package/src/utils/network-policy-navigation.test.ts +21 -36
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
|
|
3
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
4
|
+
import { MemoryRouter } from 'react-router-dom'
|
|
5
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
6
|
+
import type { SubstrateStatus, SubstrateWorkspace } from '../../api/substrateWorkspace'
|
|
7
|
+
import { SUBSTRATE_NO_PROBLEMS, SubstrateOverview } from './SubstrateOverview'
|
|
8
|
+
import { connectedTier, connection, counts, notConnectedWorkspace, apiDisabledTier, mintDeniedTier, ownerTier, poolShortRow, sharedTier, status, workspace } from './substrate.fixtures'
|
|
9
|
+
|
|
10
|
+
const state = vi.hoisted(() => ({ connection: undefined as unknown }))
|
|
11
|
+
|
|
12
|
+
vi.mock('../../api/client', async (importOriginal) => ({
|
|
13
|
+
...(await importOriginal<typeof import('../../api/client')>()),
|
|
14
|
+
usePrometheusStatus: () => ({ data: { connected: true } }),
|
|
15
|
+
}))
|
|
16
|
+
vi.mock('../../api/substrateWorkspace', async (importOriginal) => ({
|
|
17
|
+
...(await importOriginal<typeof import('../../api/substrateWorkspace')>()),
|
|
18
|
+
useSubstrateConnection: () => ({ data: state.connection, isError: false }),
|
|
19
|
+
useUpdateSubstrateConnection: () => ({ mutate: vi.fn(), isPending: false }),
|
|
20
|
+
}))
|
|
21
|
+
|
|
22
|
+
// renderToStaticMarkup escapes apostrophes; compare against the text a reader sees.
|
|
23
|
+
const text = (html: string) => html.replace(/'/g, "'").replace(/"/g, '"').replace(/&/g, '&')
|
|
24
|
+
// Names wrap only after a hyphen, so each segment is its own span; read them as the reader does.
|
|
25
|
+
const plain = (html: string) => html.replace(/<\/?span[^>]*>/g, '')
|
|
26
|
+
// The words alone: glossary terms and tooltips sit inside sentences.
|
|
27
|
+
const words = (html: string) => html.replace(/<[^>]+>/g, '')
|
|
28
|
+
|
|
29
|
+
function render(data: SubstrateWorkspace, st: SubstrateStatus | undefined = status({ apiTier: data.apiTier })) {
|
|
30
|
+
return text(renderToStaticMarkup(
|
|
31
|
+
<MemoryRouter>
|
|
32
|
+
<SubstrateOverview data={data} status={st} onOpenSubject={() => {}} />
|
|
33
|
+
</MemoryRouter>,
|
|
34
|
+
))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe('Agent Substrate overview, connected', () => {
|
|
38
|
+
it('says where its values come from: the API, who Radar reads as, Prometheus', () => {
|
|
39
|
+
const html = render(workspace(), status({ apiTier: connectedTier }))
|
|
40
|
+
expect(html).toContain('ate-system/api:443')
|
|
41
|
+
expect(html).toContain('system:serviceaccount:ate-system:ate-client')
|
|
42
|
+
expect(html).toMatch(/Prometheus<\/span><span[^>]*>connected/)
|
|
43
|
+
expect(html).toContain('Change connection')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('reads the sourced At a glance rows from Substrate’s counts', () => {
|
|
47
|
+
const html = render(workspace())
|
|
48
|
+
expect(html).toContain('3 pools · 1 short of workers · 1 full')
|
|
49
|
+
expect(html).toContain('18 active · 1 draining · 1 unavailable')
|
|
50
|
+
expect(html).toContain('212 of 236 actor slots used')
|
|
51
|
+
expect(html).not.toContain('free,')
|
|
52
|
+
const doc = new DOMParser().parseFromString(html, 'text/html')
|
|
53
|
+
const poolsLink = [...doc.querySelectorAll('button')].find((b) => b.textContent === 'Pools →')
|
|
54
|
+
expect(poolsLink?.parentElement?.textContent).toContain('18 active')
|
|
55
|
+
expect(poolsLink?.parentElement?.textContent).not.toContain('actor slots used')
|
|
56
|
+
expect(poolsLink?.parentElement?.nextElementSibling?.textContent).toContain('actor slots used')
|
|
57
|
+
expect(poolsLink?.parentElement?.nextElementSibling?.lastElementChild?.textContent).toBe('Kubernetes WorkerPools and Substrate API')
|
|
58
|
+
expect(html).toContain('1,284 total, 14 crashed')
|
|
59
|
+
expect(words(html)).toContain('6 templates · 1 golden snapshot failed')
|
|
60
|
+
// One run of text, not an element per part: the facts row is a flex row
|
|
61
|
+
// whose gap would set each comma apart from the word before it.
|
|
62
|
+
expect(html).toContain('6 templates · 1 ')
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('leads with Needs attention in the server’s order and labels broader crash links', () => {
|
|
66
|
+
const html = render(workspace())
|
|
67
|
+
expect(html).not.toContain('aria-label="Actors by state"')
|
|
68
|
+
expect(html.indexOf('Needs attention')).toBeLessThan(html.indexOf('At a glance'))
|
|
69
|
+
const attention = html.slice(html.indexOf('Needs attention'))
|
|
70
|
+
expect(attention).toContain('Findings can group several actors.')
|
|
71
|
+
// The fixture's order is the server's ranking: crash, pool, golden snapshot. No category regrouping.
|
|
72
|
+
const crash = attention.indexOf('14 actors are crashed')
|
|
73
|
+
const pool = attention.indexOf('is short of workers')
|
|
74
|
+
const golden = attention.indexOf('has no golden snapshot')
|
|
75
|
+
expect(crash).toBeLessThan(pool)
|
|
76
|
+
expect(pool).toBeLessThan(golden)
|
|
77
|
+
// Each row names its kind on the subject line, as Velero's and Agent Sandbox's rows do.
|
|
78
|
+
expect(attention).toMatch(/<span>Pool <span[^>]*><span><button[^>]*><span[^>]*>agent-pool</)
|
|
79
|
+
expect(attention).toContain('14 actors are crashed')
|
|
80
|
+
// Where most of them are, as a concentration with a link, not a cause.
|
|
81
|
+
expect(words(attention)).toContain('11 of the 14 use template research / langgraph-research')
|
|
82
|
+
expect(attention).toContain('View all crashed actors →')
|
|
83
|
+
expect(attention).toContain('research / langgraph-research')
|
|
84
|
+
expect(attention).toContain('Substrate’s messages')
|
|
85
|
+
expect(attention).toContain('By template')
|
|
86
|
+
expect(attention).toContain('Next step: ')
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('keeps the healthy state compact and the check evidence in a closed disclosure', () => {
|
|
90
|
+
const html = render(workspace({ needsAttention: [] }))
|
|
91
|
+
expect(html).toContain(SUBSTRATE_NO_PROBLEMS)
|
|
92
|
+
const checks = html.slice(html.indexOf('What was checked'), html.indexOf('At a glance'))
|
|
93
|
+
expect(checks).toContain('inert=""')
|
|
94
|
+
expect(checks).toContain('Crashed actors')
|
|
95
|
+
expect(checks).toContain('Not assessed by any check')
|
|
96
|
+
expect(checks).toContain('Request routing and egress')
|
|
97
|
+
expect(html).toContain('>Pools →</button>')
|
|
98
|
+
expect(html).not.toContain('Slots on active workers</th>')
|
|
99
|
+
expect(plain(html)).toContain('support-bots')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
it('says checks waiting on Prometheus’s first answer are still running, and ones Prometheus can’t serve could not run', () => {
|
|
103
|
+
const collecting = 'Radar is collecting Substrate’s metrics from Prometheus; they show on the next refresh'
|
|
104
|
+
const base = workspace()
|
|
105
|
+
const ws = {
|
|
106
|
+
...base,
|
|
107
|
+
checks: [
|
|
108
|
+
...base.checks,
|
|
109
|
+
{ rule: 'poolService' as const, label: 'Substrate’s pool capacity verdicts (Prometheus)', ran: false, why: collecting, collecting: true },
|
|
110
|
+
{ rule: 'nodeUploadsOverdue' as const, label: 'Overdue snapshot uploads per node (Prometheus)', ran: false, why: collecting, collecting: true },
|
|
111
|
+
],
|
|
112
|
+
service: { ...base.service, why: collecting, collecting: true },
|
|
113
|
+
}
|
|
114
|
+
let html = words(render(ws))
|
|
115
|
+
expect(html).toContain('What was checked3 of 5 checks ran · 2 still running')
|
|
116
|
+
expect(html).not.toContain('checks ran · 2 could not')
|
|
117
|
+
expect(html).toContain(`Still running: ${collecting}`)
|
|
118
|
+
// The Delivery fact doesn't claim an absence Radar hasn't read yet.
|
|
119
|
+
expect(html).toContain('being collected from Prometheus')
|
|
120
|
+
expect(html).not.toContain('no Substrate metrics')
|
|
121
|
+
// Prometheus not connected: the honest state is that they could not run, and why.
|
|
122
|
+
const down = { ...ws, checks: ws.checks.map((c) => (c.collecting ? { ...c, why: 'Prometheus is not connected', collecting: false } : c)), service: base.service }
|
|
123
|
+
html = words(render(down))
|
|
124
|
+
expect(html).toContain('What was checked3 of 5 checks ran · 2 could not')
|
|
125
|
+
expect(html).not.toContain('still running')
|
|
126
|
+
expect(html).toContain('Substrate’s pool capacity verdicts (Prometheus): Prometheus is not connected')
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
it('defines atespace where the Overview first names it', () => {
|
|
130
|
+
const raw = render(workspace())
|
|
131
|
+
expect(raw).toMatch(/decoration-dotted[^>]*>Atespaces<\/span>/)
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('says an atespace Substrate denied is unread, never empty', () => {
|
|
135
|
+
const html = render(workspace())
|
|
136
|
+
const row = html.slice(html.indexOf('restricted'))
|
|
137
|
+
expect(row).toContain('No access')
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
it('gives an atespace read in part a lower bound, and one not read no number', () => {
|
|
141
|
+
const html = render(workspace({
|
|
142
|
+
atespaces: [
|
|
143
|
+
{ name: 'budgetcut', actorsRead: 'partial', actors: counts({ running: 3 }), templatesRead: 'full', templates: 1 },
|
|
144
|
+
{ name: 'outofscope', actorsRead: 'unread', templatesRead: 'unread' },
|
|
145
|
+
],
|
|
146
|
+
}))
|
|
147
|
+
const partial = html.slice(html.indexOf('budgetcut'), html.indexOf('outofscope'))
|
|
148
|
+
expect(partial).toContain('aria-label="At least: Radar read only part of this atespace’s actors"')
|
|
149
|
+
const unread = html.slice(html.indexOf('outofscope'))
|
|
150
|
+
expect(unread).toContain('not read')
|
|
151
|
+
expect(unread).not.toMatch(/>0</)
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
it('raises no coverage notice for kinds not read because the API tier is down', () => {
|
|
155
|
+
expect(render(notConnectedWorkspace())).not.toContain('Radar couldn’t read all of what this screen shows')
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('makes counts over a partial read lower bounds, and says what it could not read', () => {
|
|
159
|
+
const base = workspace()
|
|
160
|
+
const html = render(workspace({ needsAttention: [], coverage: { ...base.coverage!, actors: { state: 'partial', deniedAtespaces: ['restricted'] } } }))
|
|
161
|
+
expect(html).toContain('Radar couldn’t read all of what this screen shows')
|
|
162
|
+
expect(html).toContain('Substrate denied atespace restricted')
|
|
163
|
+
expect(html).toContain('aria-label="At least: some of it could not be read"')
|
|
164
|
+
expect(html).toContain(SUBSTRATE_NO_PROBLEMS)
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
describe('Agent Substrate overview, not connected', () => {
|
|
169
|
+
it('keeps what Kubernetes shows, and says actor values are not connected rather than 0', () => {
|
|
170
|
+
state.connection = connection()
|
|
171
|
+
const html = render(notConnectedWorkspace())
|
|
172
|
+
const body = words(html)
|
|
173
|
+
expect(body).toContain('Worker capacity1 pool · 6 Pods ready of 6 desiredPools →Not connectedKubernetes WorkerPools and Substrate API')
|
|
174
|
+
expect(body).toContain('ActorsNot connectedActors →')
|
|
175
|
+
expect(body).toContain('Template startupNot connectedTemplates →')
|
|
176
|
+
expect(body).not.toContain('Actors0')
|
|
177
|
+
expect(html).toContain('Not checked on this read')
|
|
178
|
+
expect(html).toContain('Crashed actors: actors were not read')
|
|
179
|
+
expect(body).toContain('Delivery metricsUnavailable · no Substrate series')
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
it('offers Settings → Agent Substrate where actors would be, on a local Radar', () => {
|
|
183
|
+
const html = render(notConnectedWorkspace())
|
|
184
|
+
expect(html).toContain('Connect to Substrate’s API')
|
|
185
|
+
expect(html).toContain('>Open Substrate settings</button>')
|
|
186
|
+
// The form lives in Settings; the workspace never edits the connection.
|
|
187
|
+
expect(html).not.toContain('Who Radar reads Substrate as')
|
|
188
|
+
expect(html).not.toContain('Disconnect')
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it('explains why a shared Radar without sign-in does not read the API, and what turns it on', () => {
|
|
192
|
+
const data = notConnectedWorkspace(sharedTier)
|
|
193
|
+
const html = render(data, status({ apiTier: sharedTier, canConfigure: false }))
|
|
194
|
+
expect(html).toContain('Needs sign-in')
|
|
195
|
+
expect(html).toContain('Turn on sign-in for this Radar')
|
|
196
|
+
expect(html).toContain('>Connection settings</button>')
|
|
197
|
+
expect(html).not.toContain('Open Substrate settings')
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it('reads each failure plainly with a next step', () => {
|
|
201
|
+
const tier = { state: 'failed' as const, code: 'unreachable' as const, reason: 'dial tcp 127.0.0.1:443: connection refused' }
|
|
202
|
+
const html = render(notConnectedWorkspace(tier))
|
|
203
|
+
expect(html).toContain('Substrate API: api server unreachable')
|
|
204
|
+
expect(html).toContain('connection refused')
|
|
205
|
+
expect(html).toContain('Next step: </span>Check that the API server’s Pods are running')
|
|
206
|
+
const denied = render(notConnectedWorkspace({ state: 'failed', code: 'denied', reason: 'permission denied' }))
|
|
207
|
+
expect(denied).toContain('viewer role')
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
describe('Agent Substrate on an in-cluster Radar with sign-in, or Radar Hub', () => {
|
|
212
|
+
it('tells a signed-in person which identity Radar reads as, with nothing to connect or change', () => {
|
|
213
|
+
const html = render(workspace({ apiTier: ownerTier }), status({ apiTier: ownerTier, canConfigure: false }))
|
|
214
|
+
expect(html).toContain('api.ate-system.svc:443</span> as Substrate’s shared client identity (')
|
|
215
|
+
expect(html).toContain('ate-system/ate-client</span>), minted with your Kubernetes access')
|
|
216
|
+
expect(html).toContain('aria-label="About this identity"')
|
|
217
|
+
expect(html).not.toContain('Change connection')
|
|
218
|
+
expect(html).toContain('>Connection settings</button>')
|
|
219
|
+
// Their own access could mint the token: the actors are there.
|
|
220
|
+
expect(words(html)).toContain('Actors1,284 total, 14 crashed')
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
it('says when the operator turned the API off, and keeps Kubernetes and Prometheus', () => {
|
|
224
|
+
const data = notConnectedWorkspace(apiDisabledTier)
|
|
225
|
+
const html = render(data, status({ apiTier: apiDisabledTier, canConfigure: false }))
|
|
226
|
+
expect(html).toContain('Turned off for this Radar')
|
|
227
|
+
expect(html).toContain('substrate.api.enabled')
|
|
228
|
+
expect(html).not.toContain('Open Substrate settings')
|
|
229
|
+
expect(html).not.toContain('Substrate API: ')
|
|
230
|
+
expect(html).toContain('Worker capacity')
|
|
231
|
+
expect(html).toContain('Prometheus')
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
it('tells a person whose access can’t mint the token what to ask for, and how to check', () => {
|
|
235
|
+
const html = render(notConnectedWorkspace(mintDeniedTier), status({ apiTier: mintDeniedTier, canConfigure: false }))
|
|
236
|
+
expect(html).toContain('Substrate API: couldn’t create the shared identity’s token')
|
|
237
|
+
expect(html).toContain('serviceaccounts/token for ate-client in ate-system')
|
|
238
|
+
expect(html).toContain('kubectl auth can-i create serviceaccounts/ate-client --subresource=token -n ate-system')
|
|
239
|
+
// The banner states the next step once; the notice below only leads to Settings.
|
|
240
|
+
expect(html.split('ask a cluster admin for create on serviceaccounts/token').length - 1).toBe(1)
|
|
241
|
+
expect(html).toContain('Actors, templates and workers aren’t read')
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
it('gives a person whose install lacks the shared identity a kubectl check, not a form', () => {
|
|
245
|
+
const tier = { state: 'failed' as const, code: 'notInstalled' as const, identity: { mode: 'sharedAsCaller' as const }, reason: 'ServiceAccount ate-system/ate-client does not exist.' }
|
|
246
|
+
const html = render(notConnectedWorkspace(tier), status({ apiTier: tier, canConfigure: false }))
|
|
247
|
+
expect(html).toContain('Substrate’s shared client identity (ate-system/ate-client) doesn’t exist here.')
|
|
248
|
+
expect(html).toContain('kubectl -n ate-system get sa ate-client'.split(' ').pop()!)
|
|
249
|
+
expect(html).not.toContain('Advanced')
|
|
250
|
+
expect(html).not.toContain('Who Radar reads Substrate as')
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
it('sends a local Radar to its settings, and tells a shared one without sign-in why not', () => {
|
|
254
|
+
const local = render(notConnectedWorkspace())
|
|
255
|
+
expect(local).toContain('Open Substrate settings')
|
|
256
|
+
const shared = render(notConnectedWorkspace(sharedTier), status({ apiTier: sharedTier, canConfigure: false }))
|
|
257
|
+
expect(shared).toContain('Needs sign-in')
|
|
258
|
+
expect(shared).not.toContain('org owner')
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
describe('Agent Substrate status line beside the inventory', () => {
|
|
263
|
+
it('never reads a missing Prometheus count as calm, and lets crashed actors and unstored snapshots set the colour', async () => {
|
|
264
|
+
const { serviceFacts } = await import('./SubstrateOverview')
|
|
265
|
+
const upload = { id: 'uploadOverdue', rule: 'uploadOverdue' as const, severity: 'critical' as const, title: 't', reading: 'r', nextStep: 'n', subject: { kind: 'Actors' as const }, count: 24 }
|
|
266
|
+
// Prometheus was read but counted no crashes and no overdue node, while the API lists 15 crashed and 24 unstored.
|
|
267
|
+
const facts = serviceFacts({
|
|
268
|
+
service: { read: true, slowestResume: { pool: { namespace: 'n', name: 'agent-pool' }, value: 4.8 }, poolsUnknown: 2, nodesOverdue: 0, nodesUnknown: 0 },
|
|
269
|
+
summary: { pools: { total: 1, short: 0, full: 0, noRoom: 0 }, actors: { total: 100, crashed: 15, attentionCount: 24 } },
|
|
270
|
+
needsAttention: [upload],
|
|
271
|
+
})
|
|
272
|
+
const crashes = facts.find((f) => String(f.label).startsWith('Crashes'))!
|
|
273
|
+
expect(crashes.tone).toBe('unhealthy')
|
|
274
|
+
expect(crashes.lowerBound).toBeFalsy()
|
|
275
|
+
expect(renderToStaticMarkup(<>{crashes.value}</>)).toContain('unknown')
|
|
276
|
+
const uploads = facts.find((f) => f.label === 'Uploads')!
|
|
277
|
+
expect(uploads.value).toBe('24 snapshots not stored yet')
|
|
278
|
+
expect(uploads.tone).toBe('unhealthy')
|
|
279
|
+
expect(uploads.lowerBound).toBeFalsy()
|
|
280
|
+
// Nothing healthy-green that the inventory contradicts, and no "≥" before an unknown or zero.
|
|
281
|
+
expect(facts.filter((f) => f.tone === 'healthy').map((f) => f.label)).toEqual(['Resumes (1h)'])
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
it('shows a partial zero as unknown and a positive partial count as a lower bound', async () => {
|
|
285
|
+
const { serviceFacts } = await import('./SubstrateOverview')
|
|
286
|
+
const summary = { pools: { total: 2, short: 0, full: 0, noRoom: 0 } }
|
|
287
|
+
const crashFact = (crashes: number, poolsUnknown: number) => serviceFacts({
|
|
288
|
+
service: { read: true, crashes, poolsUnknown, nodesOverdue: 0, nodesUnknown: 0 },
|
|
289
|
+
summary, needsAttention: [],
|
|
290
|
+
}).find((f) => f.label === 'Crashes (1h)')!
|
|
291
|
+
|
|
292
|
+
const partial = crashFact(0, 1)
|
|
293
|
+
expect(partial.tone).toBe('unknown')
|
|
294
|
+
expect(renderToStaticMarkup(<>{partial.value}</>)).toContain('unknown')
|
|
295
|
+
expect(crashFact(2, 1)).toMatchObject({ value: '2', tone: 'unhealthy', lowerBound: true })
|
|
296
|
+
expect(crashFact(0, 0)).toMatchObject({ value: '0', tone: 'healthy', lowerBound: false })
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
it('reads a condition in its row’s tone: an unavailable worker, a template no pool matches, an overdue upload are alerts', async () => {
|
|
300
|
+
const { overviewFacts, serviceFacts } = await import('./SubstrateOverview')
|
|
301
|
+
const base = workspace()
|
|
302
|
+
const unavailable = { ...poolShortRow, id: 'workerUnavailable:w', rule: 'workerUnavailable' as const, severity: 'alert' as const, subject: { kind: 'Worker' as const, namespace: 'ns', name: 'w' } }
|
|
303
|
+
const tones = (data: ReturnType<typeof workspace>) => Object.fromEntries(overviewFacts(data).map((f) => [renderToStaticMarkup(<>{f.label}</>).replace(/<[^>]+>/g, ''), f.tone]))
|
|
304
|
+
// Workers: 1 unavailable in the fixture is at risk, orange, with or without its row yet.
|
|
305
|
+
expect(tones(base).Workers).toBe('alert')
|
|
306
|
+
expect(tones({ ...base, needsAttention: [...base.needsAttention, unavailable] }).Workers).toBe('alert')
|
|
307
|
+
// A lost sandbox on a worker is critical: the fact takes the worst row's tone.
|
|
308
|
+
const lost = { ...unavailable, id: 'workerRestarting:w', rule: 'workerRestarting' as const, severity: 'critical' as const }
|
|
309
|
+
expect(tones({ ...base, needsAttention: [...base.needsAttention, lost] }).Workers).toBe('unhealthy')
|
|
310
|
+
// An info row (a drain within its deadline) does not colour it.
|
|
311
|
+
const draining = { ...unavailable, id: 'workerDraining:w', rule: 'workerDraining' as const, severity: 'info' as const }
|
|
312
|
+
const calm = { ...base, summary: { ...base.summary, workers: { ...base.summary.workers!, unavailable: 0 } }, needsAttention: [draining] }
|
|
313
|
+
expect(tones(calm).Workers).toBe('healthy')
|
|
314
|
+
// Templates: one no pool matches is an alert; a failed golden snapshot alone stays a warning.
|
|
315
|
+
const t = base.summary.templates!
|
|
316
|
+
expect(tones({ ...base, summary: { ...base.summary, templates: { ...t, noMatchingPool: 1 } } }).Templates).toBe('alert')
|
|
317
|
+
expect(tones({ ...base, summary: { ...base.summary, templates: { ...t, noMatchingPool: 0, goldenFailed: 1 } }, needsAttention: [] }).Templates).toBe('degraded')
|
|
318
|
+
// Uploads: an alert row while the nodes are up.
|
|
319
|
+
const upload = { ...poolShortRow, id: 'uploadOverdue', rule: 'uploadOverdue' as const, severity: 'alert' as const, count: 3 }
|
|
320
|
+
expect(serviceFacts({ service: base.service, summary: base.summary, needsAttention: [upload] }).find((f) => f.label === 'Uploads')!.tone).toBe('alert')
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
it('shows unknown tone for empty partial counts and neutral for complete zero counts', async () => {
|
|
324
|
+
const { overviewFacts } = await import('./SubstrateOverview')
|
|
325
|
+
const data = workspace({ needsAttention: [] })
|
|
326
|
+
data.summary.actors = { ...data.summary.actors!, total: 0, crashed: 0 }
|
|
327
|
+
data.summary.templates = { ...data.summary.templates!, total: 0, goldenFailed: 0, noMatchingPool: 0 }
|
|
328
|
+
const countFacts = () => overviewFacts(data).filter((f) => f.label === 'Actors' || f.label === 'Templates')
|
|
329
|
+
expect(countFacts().map((f) => f.tone)).toEqual(['neutral', 'neutral'])
|
|
330
|
+
data.coverage.actors = { state: 'partial' }
|
|
331
|
+
data.coverage.templates = { state: 'partial' }
|
|
332
|
+
expect(countFacts()).toMatchObject([
|
|
333
|
+
{ value: 'Actor count unknown', tone: 'unknown' },
|
|
334
|
+
{ value: 'Template count unknown', tone: 'unknown' },
|
|
335
|
+
])
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
it('never counts free slots as room, and names pools with no CPU or memory for another actor', async () => {
|
|
339
|
+
const { overviewFacts } = await import('./SubstrateOverview')
|
|
340
|
+
const slotLine = (data: ReturnType<typeof workspace>) => {
|
|
341
|
+
const f = overviewFacts(data).find((f) => words(renderToStaticMarkup(<>{f.label}</>)) === 'Actor slots')!
|
|
342
|
+
return { value: text(String(f.value)), tone: f.tone }
|
|
343
|
+
}
|
|
344
|
+
const base = workspace()
|
|
345
|
+
const pool = { namespace: 'kagent', name: 'agent-pool' }
|
|
346
|
+
// The live case: one worker, 1,000 slots, 1 used, and not the CPU for a second actor.
|
|
347
|
+
const live = { ...base, summary: { ...base.summary, pools: { total: 1, short: 0, full: 0, noRoom: 1 }, slots: { used: 1, total: 1000 }, freeSlots: [{ pool, free: 999, lacking: 'cpu' as const }] } }
|
|
348
|
+
expect(slotLine(live)).toEqual({ value: '1 of 1,000 actor slots used · agent-pool’s workers have no CPU left for an actor', tone: 'degraded' })
|
|
349
|
+
const poolsFact = overviewFacts(live).find((f) => words(renderToStaticMarkup(<>{f.label}</>)) === 'Worker pools')!
|
|
350
|
+
expect(poolsFact.value).toBe('1 pool · 1 with no room for an actor')
|
|
351
|
+
expect(poolsFact.tone).not.toBe('healthy')
|
|
352
|
+
// Mixed: the pool without room is named; the others' free slots are not counted out as room.
|
|
353
|
+
const mixed = { ...base, summary: { ...base.summary, freeSlots: [{ pool: { namespace: 'batch', name: 'batch-pool' }, free: 21, lacking: 'memory' as const }, { pool: { namespace: 'agent-ns', name: 'agent-pool' }, free: 3 }] } }
|
|
354
|
+
expect(slotLine(mixed)).toEqual({ value: '212 of 236 actor slots used · batch-pool’s workers have no memory left for an actor', tone: 'healthy' })
|
|
355
|
+
const two = { ...base, summary: { ...base.summary, freeSlots: [{ pool: { namespace: 'batch', name: 'batch-pool' }, free: 11, lacking: 'memory' as const }, { pool, free: 10, lacking: 'cpu' as const }, { pool: { namespace: 'agent-ns', name: 'agent-pool' }, free: 3 }] } }
|
|
356
|
+
expect(slotLine(two)).toEqual({ value: '212 of 236 actor slots used · 2 pools’ workers have no CPU or memory left for an actor', tone: 'healthy' })
|
|
357
|
+
// No pool short of CPU or memory (or an older Radar that sends no lacking): just the count.
|
|
358
|
+
expect(slotLine(base)).toEqual({ value: '212 of 236 actor slots used', tone: 'healthy' })
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
it('folds an unmeasured Prometheus into one unknown fact', async () => {
|
|
362
|
+
const { serviceFacts } = await import('./SubstrateOverview')
|
|
363
|
+
const facts = serviceFacts({ service: { read: true, poolsUnknown: 3, nodesOverdue: 0, nodesUnknown: 2 }, summary: { pools: { total: 3, short: 0, full: 0, noRoom: 0 } }, needsAttention: [] })
|
|
364
|
+
expect(facts).toHaveLength(1)
|
|
365
|
+
expect(facts[0]).toMatchObject({ label: 'Delivery (1h)', tone: 'unknown' })
|
|
366
|
+
})
|
|
367
|
+
})
|
|
368
|
+
|
|
369
|
+
it('keeps coverage and refresh warnings visible with the coverage disclosure closed', () => {
|
|
370
|
+
const ws = workspace()
|
|
371
|
+
ws.coverage.actors = { state: 'partial', deniedAtespaces: ['restricted'] }
|
|
372
|
+
ws.apiTier = { ...ws.apiTier, lastError: { code: 'unreachable', at: new Date().toISOString(), message: 'timed out' } }
|
|
373
|
+
ws.atespaces = [{ name: 'partial', actorsRead: 'partial', actors: counts({ running: 2 }), templatesRead: 'partial', templates: 0 }]
|
|
374
|
+
const html = render(ws)
|
|
375
|
+
const doc = new DOMParser().parseFromString(html, 'text/html')
|
|
376
|
+
const notice = [...doc.querySelectorAll('p, div')].find((n) => n.textContent?.startsWith('Radar couldn’t read all of what this screen shows') && n.children.length === 0)
|
|
377
|
+
expect(notice?.textContent).toContain('Substrate denied atespace restricted')
|
|
378
|
+
expect(notice?.closest('[inert]')).toBeNull()
|
|
379
|
+
const failure = [...doc.querySelectorAll('[role="status"]')].find((n) => n.textContent?.startsWith('Last Substrate API read failed'))
|
|
380
|
+
expect(failure?.textContent).toContain('Showing the previous read')
|
|
381
|
+
expect(failure?.textContent).toContain('timed out')
|
|
382
|
+
expect(failure?.closest('.border-theme-border')).not.toBeNull()
|
|
383
|
+
expect(failure?.closest('[inert]')).toBeNull()
|
|
384
|
+
const values = [...doc.querySelectorAll('tbody tr')].find((r) => r.firstElementChild?.textContent === 'partial')?.querySelectorAll('td')
|
|
385
|
+
expect(values?.[4].textContent).toBe('Unknown')
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
it('labels the broader suspended-actors link and makes the crash concentration actionable', () => {
|
|
389
|
+
const ws = workspace()
|
|
390
|
+
ws.needsAttention = [...ws.needsAttention, { ...poolShortRow, id: 'upload', rule: 'uploadOverdue', count: 1, subject: { kind: 'Actors', filter: { state: 'suspended' } } }]
|
|
391
|
+
const doc = new DOMParser().parseFromString(render(ws), 'text/html')
|
|
392
|
+
const buttons = [...doc.querySelectorAll('button')]
|
|
393
|
+
expect(buttons.some((b) => b.textContent === 'View all suspended actors →')).toBe(true)
|
|
394
|
+
const concentration = [...doc.querySelectorAll('div')].find((n) => n.textContent === '11 of the 14 use template research / langgraph-research' && n.firstElementChild?.tagName === 'BUTTON')
|
|
395
|
+
expect(concentration?.querySelector('button')?.textContent).toBe('research / langgraph-research')
|
|
396
|
+
})
|