Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix(ui): standardize table attention filters

rcourtmana3d63e08b6f7
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 95a3ba9f1e..18a084c6c2 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -5515,11 +5515,15 @@ Protection table controls continue to compose shared filter, table, status,
counter, loading, error, disclosure, and inline-detail primitives. The bounded
batch hook retains fulfilled values during refresh and issues at most one
request per 200 resource rows, rather than placing a request under each row.
-TrueNAS protection history keeps issue prominence inside that existing control
-rail: the Attention filter carries the compact failed/warning count, and the
-built-in row order places failed then warning outcomes ahead of routine recency.
-It must not add a page-level posture summary card above the toolbar; running
-replication remains an ordinary event state rather than page-level alarm copy.
+Table-local provider histories keep issue prominence inside that existing
+control rail through `withPlatformAttentionCount`: TrueNAS Protection carries
+the compact failed/warning count, vSphere Health carries the compact
+critical/warning count, and each built-in row order keeps attention ahead of
+routine activity. They must not add page-level attention summary cards above
+their toolbars. Full-width attention summaries are reserved for genuinely
+cross-section overview state, such as Kubernetes aggregating nodes, workloads,
+and health signals with distinct destinations. Running replication remains an
+ordinary event state rather than page-level alarm copy.
### Operational Trust attention interaction boundary
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 101ecae7ff..036c64fe49 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -2898,6 +2898,10 @@ severity-label helpers, detail severity row tones must use
and their severity toolbar filters must use
`getPlatformAlertSeverityFilterOptions` instead of restoring local
All/Critical/Warning/Info option arrays,
+and table-local aggregate Attention filters must compose
+`withPlatformAttentionCount` instead of restoring provider-local count badges
+or page-level attention summary cards; cross-section overview summaries remain
+a separate frontend-primitives concern,
and platform alert detail fields must use
`formatPlatformAlertCode`, `formatPlatformAlertResourceType`,
`formatPlatformAlertEntityType`, `formatPlatformAlertStartedAt`, and
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 3f6ef833e1..fa3c2493e6 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,40 +1,37 @@
{
"version": 1,
- "base_sha": "6fc571bcb14cddec3eaf5cd1c94807c5b5e9cd0d",
- "verified_at": "2026-08-05T12:44:42Z",
+ "base_sha": "9524c6ac79e68c95f1a1760ccfdca65233da6f36",
+ "verified_at": "2026-08-05T12:43:32Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx",
- "frontend-modern/src/components/shared/selectablePillModel.ts"
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx",
+ "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereAlertsTable.tsx"
],
"content_sha256": {
- "frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx": "dd8a0285f791a4a7b9ee6edced172ef9fea0dabecff8770ddd83fe0791e3f5bd",
- "frontend-modern/src/components/shared/selectablePillModel.ts": "0cb855ed62ec2fd620191580ae777b4ed1fc9a4f9f70717a7b97c42c4be0f6bc"
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx": "195d9d568f05d075cf82f9d3f09b76332d9b7438c7db00b2854fd59385672874",
+ "frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx": "4dcfeaa8e4a4b79e37d6121e25fcd5395257c32ad1e947e4551584c672935339",
+ "frontend-modern/src/features/vmware/VsphereAlertsTable.tsx": "5562fdee0d1b74a9ea819962183a5860b9fb4a9677fd66ed7182639e5218b1b4"
},
"routes": [
- "/settings/pulse-intelligence/assistant",
- "/settings/security/api"
+ "/truenas/protection",
+ "/vmware/health"
],
"viewports": [
- { "width": 320, "height": 800 },
- { "width": 375, "height": 812 },
- { "width": 768, "height": 900 },
- { "width": 1024, "height": 900 },
- { "width": 1280, "height": 900 },
- { "width": 1600, "height": 1000 }
+ { "width": 390, "height": 844 },
+ { "width": 1440, "height": 1000 }
],
"states": [
- "Assistant settings with no provider configured and Observe only selected",
- "Assistant chat action label, select, and explanatory copy stacked at both phone widths",
- "Assistant chat action control restored to its aligned row layout from tablet through wide desktop",
- "API token compact inventory and create-token presets at phone, tablet, and desktop widths",
- "API custom scopes expanded with long Docker and Kubernetes scope labels wrapping inside the card",
- "API token desktop table with all seven operator columns visible at 1600 pixels"
+ "vSphere health default history with the compact counted Attention filter and no posture banner",
+ "vSphere Attention filter selected with all five warning health signals visible",
+ "TrueNAS protection default history with one failed event and the compact counted Attention filter",
+ "TrueNAS Attention filter selected with the one matching failed event",
+ "Filters expanded at the narrow viewport on both routes"
],
"interactions": [
- "Expanded Custom scopes at 320 and 375 pixels and measured both long scope pills inside the card bounds",
- "Verified the Assistant select and its help text stay inside the action-permission panel at all six widths",
- "Verified both routes keep document scroll width equal to client width at all six widths",
- "Compared the API token compact cards below 1600 pixels with the full desktop token table"
+ "Selected and cleared the vSphere Attention filter at desktop and narrow viewports",
+ "Selected and cleared the TrueNAS Attention filter at desktop and narrow viewports",
+ "Verified the vSphere and TrueNAS result counts track each counted Attention filter",
+ "Verified both narrow layouts keep document scroll width equal to client width"
]
}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index b21b69a2ee..f5472c5dfd 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -5249,6 +5249,19 @@ describe('shared primitive guardrails', () => {
);
});
+ it('keeps table-local attention counts on the shared platform filter template', () => {
+ expect(sharedPlatformPageSource).toContain('export function withPlatformAttentionCount');
+ expect(sharedPlatformPageSource).toContain('<MetadataBadge');
+
+ for (const source of [truenasProtectionTableSource, vsphereAlertsTableSource]) {
+ expect(source).toContain('withPlatformAttentionCount');
+ expect(source).not.toContain('PlatformAttentionSummary');
+ expect(source).not.toContain('<MetadataBadge');
+ }
+
+ expect(kubernetesPageSurfaceSource).toContain('PlatformAttentionSummary');
+ });
+
it('keeps platform table empty states on the shared shell template', () => {
const registry = JSON.parse(sharedTemplateRegistrySource) as {
patternGuards: Array<{
diff --git a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
index e762e9c32b..e6f4e44946 100644
--- a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
@@ -171,6 +171,14 @@ const proxmoxInlineDetailTableSources = [
];
describe('platform overview layout guardrails', () => {
+ it('keeps table-local attention in filters and reserves summaries for cross-section overviews', () => {
+ for (const source of [truenasProtectionTableSource, vsphereAlertsTableSource]) {
+ expect(source).toContain('withPlatformAttentionCount');
+ expect(source).not.toContain('PlatformAttentionSummary');
+ }
+ expect(kubernetesPageSurfaceSource).toContain('PlatformAttentionSummary');
+ });
+
it('keeps platform inventory tables on the shared dense table styling contract', () => {
expect(sharedPlatformPageSource).toContain('PLATFORM_TABLE_CARD_CLASS');
expect(sharedPlatformPageSource).toContain('PLATFORM_TABLE_HEADER_ROW_CLASS');
diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
index cfa652b64d..da004b42f9 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
@@ -34,11 +34,48 @@ import {
getPlatformTableWeightedColumnWidthStyle,
normalizePlatformResourceStatusFilter,
summarizePlatformTableValues,
+ withPlatformAttentionCount,
type PlatformResourceStatusFilter,
} from '../sharedPlatformPage';
afterEach(cleanup);
+describe('withPlatformAttentionCount', () => {
+ it('decorates one attention option with a compact accessible count', () => {
+ let attention: ReturnType<typeof withPlatformAttentionCount<string>>[number] | undefined;
+ render(() => {
+ const options = withPlatformAttentionCount(
+ [
+ { value: 'all', label: 'All' },
+ { value: 'attention', label: 'Attention', tone: 'warning' },
+ ],
+ { value: 'attention', count: 2, tone: 'danger', noun: 'health signal' },
+ );
+ attention = options[1];
+ return attention.visualLabel;
+ });
+
+ expect(attention).toMatchObject({
+ ariaLabel: 'Attention, 2 health signals',
+ title: 'Show 2 health signals',
+ tone: 'danger',
+ leading: undefined,
+ });
+
+ expect(document.body).toHaveTextContent('Attention2');
+ });
+
+ it('leaves the base options undecorated when there is no attention', () => {
+ const options = withPlatformAttentionCount(
+ [{ value: 'attention', label: 'Attention', tone: 'warning' }],
+ { value: 'attention', count: 0, tone: 'warning', noun: 'issue' },
+ );
+
+ expect(options[0].visualLabel).toBeUndefined();
+ expect(options[0].ariaLabel).toBeUndefined();
+ });
+});
+
describe('getPlatformResourceCountNoun', () => {
it('uses singular platform nouns for one visible total', () => {
expect(getPlatformResourceCountNoun('machines', 1)).toBe('machine');
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 2a4806ca48..735539526b 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -5,6 +5,7 @@ import { For, Show, createMemo, createSignal, type Component, type JSX } from 's
import { EmptyState } from '@/components/shared/EmptyState';
import { type FilterOption as PlatformTableFilterOption } from '@/components/shared/FilterButtonGroup';
import { FilterBar, filterChipStatusDot, type FilterDef } from '@/components/shared/FilterBar';
+import { MetadataBadge } from '@/components/shared/MetadataBadge';
import { type SearchInputProps } from '@/components/shared/SearchInput';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/shared/Table';
import { TableCard } from '@/components/shared/TableCard';
@@ -26,6 +27,39 @@ import { getPlatformColumnAlign, type PlatformTableColumnKind } from './columnAl
export type { PlatformTableFilterOption };
+export function withPlatformAttentionCount<T extends string | number>(
+ options: readonly PlatformTableFilterOption<T>[],
+ config: {
+ value: T;
+ count: number;
+ tone: 'warning' | 'danger';
+ noun: string;
+ },
+): PlatformTableFilterOption<T>[] {
+ const count = Number.isFinite(config.count) ? Math.max(0, Math.trunc(config.count)) : 0;
+ if (count === 0) return [...options];
+
+ const countedNoun = count === 1 ? config.noun : `${config.noun}s`;
+ return options.map((option) => {
+ if (option.value !== config.value) return option;
+ return {
+ ...option,
+ ariaLabel: `${option.label}, ${count} ${countedNoun}`,
+ title: `Show ${count} ${countedNoun}`,
+ tone: config.tone,
+ leading: undefined,
+ visualLabel: (
+ <>
+ <span>{option.label}</span>
+ <MetadataBadge tone={config.tone} size="xs" aria-hidden="true">
+ {count}
+ </MetadataBadge>
+ </>
+ ),
+ };
+ });
+}
+
export type PlatformTabSpec<TabId extends string> = {
id: TabId;
label: string;
diff --git a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx
index 5df828da3f..6f1ba23bdc 100644
--- a/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASProtectionTable.tsx
@@ -1,6 +1,5 @@
import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
-import { MetadataBadge } from '@/components/shared/MetadataBadge';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableRow } from '@/components/shared/Table';
import {
@@ -23,6 +22,7 @@ import {
formatPlatformTableBytesValue,
getPlatformTableCellClassForKind,
getPlatformTableDateTimeSortValue,
+ withPlatformAttentionCount,
type PlatformTableFilterOption,
type PlatformTableSortValue,
PlatformTableShell,
@@ -52,39 +52,21 @@ import {
type DetailValueTone,
} from '@/components/shared/DetailSectionTable';
-const getTrueNASProtectionStatusOptions = (
- attention: number,
- failed: number,
-): PlatformTableFilterOption<TrueNASProtectionStatusFilter>[] => [
- { value: 'all', label: 'All' },
- {
- value: 'attention',
- label: 'Attention',
- ariaLabel:
- attention > 0 ? `Attention, ${attention} issue${attention === 1 ? '' : 's'}` : 'Attention',
- title:
- attention > 0
- ? `Show ${attention} protection issue${attention === 1 ? '' : 's'}`
- : 'Show protection issues',
- compactLabel: 'Issues',
- tone: failed > 0 ? 'danger' : 'warning',
- visualLabel: (
- <>
- <span>Attention</span>
- {attention > 0 ? (
- <MetadataBadge tone={failed > 0 ? 'danger' : 'warning'} size="xs" aria-hidden="true">
- {attention}
- </MetadataBadge>
- ) : null}
- </>
- ),
- },
- { value: 'success', label: 'Healthy', compactLabel: 'OK', tone: 'success' },
- { value: 'warning', label: 'Warning', compactLabel: 'Warn', tone: 'warning' },
- { value: 'failed', label: 'Failed', compactLabel: 'Fail', tone: 'danger' },
- { value: 'running', label: 'Running', compactLabel: 'Run', tone: 'info' },
- { value: 'unknown', label: 'Unknown', compactLabel: 'Unk', tone: 'muted' },
-];
+const TRUENAS_PROTECTION_STATUS_OPTIONS: PlatformTableFilterOption<TrueNASProtectionStatusFilter>[] =
+ [
+ { value: 'all', label: 'All' },
+ {
+ value: 'attention',
+ label: 'Attention',
+ compactLabel: 'Issues',
+ tone: 'warning',
+ },
+ { value: 'success', label: 'Healthy', compactLabel: 'OK', tone: 'success' },
+ { value: 'warning', label: 'Warning', compactLabel: 'Warn', tone: 'warning' },
+ { value: 'failed', label: 'Failed', compactLabel: 'Fail', tone: 'danger' },
+ { value: 'running', label: 'Running', compactLabel: 'Run', tone: 'info' },
+ { value: 'unknown', label: 'Unknown', compactLabel: 'Unk', tone: 'muted' },
+ ];
const detailString = (point: RecoveryPoint, key: string): string =>
asTrimmedString(point.details?.[key]) || '';
@@ -376,7 +358,12 @@ export const TrueNASProtectionTable: Component<{
const rows = createMemo(() => sortTrueNASProtectionPoints(props.points));
const posture = createMemo(() => buildTrueNASProtectionPosture(rows()));
const statusOptions = createMemo(() =>
- getTrueNASProtectionStatusOptions(posture().attention, posture().failed),
+ withPlatformAttentionCount(TRUENAS_PROTECTION_STATUS_OPTIONS, {
+ value: 'attention',
+ count: posture().attention,
+ tone: posture().failed > 0 ? 'danger' : 'warning',
+ noun: 'protection issue',
+ }),
);
const detail = createPlatformResourceDetailState({ idPrefix: 'truenas-protection-detail' });
const tableState = createPlatformTableFilterState({
diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.test.tsx
index a6aa5b5b98..2644b93945 100644
--- a/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.test.tsx
+++ b/frontend-modern/src/features/truenas/__tests__/TrueNASProtectionTable.test.tsx
@@ -49,7 +49,9 @@ describe('TrueNASProtectionTable', () => {
'failed',
);
- const attentionFilter = screen.getByRole('button', { name: 'Attention, 1 issue' });
+ const attentionFilter = screen.getByRole('button', {
+ name: 'Attention, 1 protection issue',
+ });
expect(attentionFilter).toHaveTextContent('Attention');
expect(attentionFilter).toHaveTextContent('1');
await fireEvent.click(attentionFilter);
diff --git a/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx b/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx
index 4bc1e054aa..53cf672e83 100644
--- a/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereAlertsTable.tsx
@@ -1,6 +1,4 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
-import { Button } from '@/components/shared/Button';
-import { PlatformAttentionSummary } from '@/features/platformPage/PlatformAttentionSummary';
+import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
import {
InlineDetailPanel,
compactDetailRows,
@@ -18,6 +16,7 @@ import {
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
PlatformTableShell,
+ withPlatformAttentionCount,
} from '@/features/platformPage/sharedPlatformPage';
import {
PlatformResourceDetailToggleButton,
@@ -122,7 +121,15 @@ export const VsphereAlertsTable: Component<{
filter: filterVmwareIncidents,
});
const drawer = createPlatformResourceDetailState({ idPrefix: 'vsphere-alert-drawer' });
- const posture = () => buildVmwareHealthPosture(props.incidents);
+ const posture = createMemo(() => buildVmwareHealthPosture(props.incidents));
+ const statusOptions = createMemo(() =>
+ withPlatformAttentionCount(VSPHERE_INCIDENT_STATUS_OPTIONS, {
+ value: 'attention',
+ count: posture().attention,
+ tone: posture().critical > 0 ? 'danger' : 'warning',
+ noun: 'health signal',
+ }),
+ );
const filteredEmptyState = () => getAlertFilteredEmptyState('vSphere health signals', 'severity');
return (
@@ -137,30 +144,6 @@ export const VsphereAlertsTable: Component<{
}
>
<div class="space-y-3">
- <Show when={posture().attention > 0}>
- <PlatformAttentionSummary
- title="vSphere attention"
- headline={`${posture().attention} health signal${posture().attention === 1 ? '' : 's'} ${posture().attention === 1 ? 'needs' : 'need'} review`}
- description="Review affected resources before opening lower-priority informational signals. Provider identifiers remain available in each row's detail."
- tone={posture().critical > 0 ? 'danger' : 'warning'}
- metrics={[
- { label: 'critical', value: posture().critical },
- { label: 'warning', value: posture().warning },
- { label: 'resources', value: posture().affectedResources },
- ]}
- actions={
- <Button
- variant="secondary"
- size="sm"
- onClick={() =>
- tableState.setStatus(tableState.status() === 'attention' ? 'all' : 'attention')
- }
- >
- {tableState.status() === 'attention' ? 'Show all signals' : 'Show attention'}
- </Button>
- }
- />
- </Show>
<Show when={props.showToolbar !== false}>
<PlatformTableToolbar
search={tableState.search}
@@ -168,7 +151,7 @@ export const VsphereAlertsTable: Component<{
searchPlaceholder="Search vSphere health"
status={tableState.status()}
onStatusChange={tableState.setStatus}
- statusOptions={VSPHERE_INCIDENT_STATUS_OPTIONS}
+ statusOptions={statusOptions()}
visible={tableState.visible()}
total={tableState.total()}
rowNoun="signals"
diff --git a/frontend-modern/src/features/vmware/__tests__/VsphereAlertsTable.test.tsx b/frontend-modern/src/features/vmware/__tests__/VsphereAlertsTable.test.tsx
index b3d67cd2d0..3725d31799 100644
--- a/frontend-modern/src/features/vmware/__tests__/VsphereAlertsTable.test.tsx
+++ b/frontend-modern/src/features/vmware/__tests__/VsphereAlertsTable.test.tsx
@@ -44,7 +44,25 @@ afterEach(() => {
describe('VsphereAlertsTable', () => {
it('renders native vSphere health signal rows with inline details', async () => {
const host = makeHost();
- const incidents = buildVmwareIncidentRows([host]);
+ const informational = makeHost({
+ id: 'datastore-info',
+ type: 'storage',
+ name: 'archive-datastore',
+ displayName: 'archive-datastore',
+ status: 'online',
+ incidents: [
+ {
+ provider: 'vmware',
+ nativeId: 'alarm-info',
+ code: 'vmware_health_state',
+ severity: 'info',
+ source: 'vmware',
+ summary: 'Datastore archive-datastore health is green',
+ startedAt: '2026-05-21T14:35:00Z',
+ },
+ ],
+ });
+ const incidents = buildVmwareIncidentRows([informational, host]);
render(() => (
<VsphereAlertsTable
@@ -52,7 +70,6 @@ describe('VsphereAlertsTable', () => {
emptyIcon={<span />}
emptyTitle="No signals"
emptyDescription="No signals"
- showToolbar={false}
/>
));
@@ -63,18 +80,27 @@ describe('VsphereAlertsTable', () => {
expect(within(table).getByText('vCenter')).toBeInTheDocument();
expect(within(table).getByText('Entity')).toBeInTheDocument();
expect(screen.getByText('esxi-01.lab.local')).toBeInTheDocument();
- expect(screen.getByText('Critical')).toBeInTheDocument();
+ expect(within(table).getByText('Critical')).toBeInTheDocument();
expect(
screen.getByText('Host host-101 has VMware alarm Host connection and power state (red)'),
).toBeInTheDocument();
- expect(screen.getByText('lab-vcenter')).toBeInTheDocument();
- expect(screen.getByText('host-101')).toBeInTheDocument();
- expect(screen.getByRole('region', { name: 'vSphere attention' })).toHaveTextContent(
- '1 health signal needs review',
- );
+ expect(screen.queryByRole('region', { name: 'vSphere attention' })).not.toBeInTheDocument();
+ expect(document.querySelectorAll('[data-vsphere-alert-row]')).toHaveLength(2);
+ const firstRow = document.querySelector('[data-vsphere-alert-row]') as HTMLElement;
+ expect(firstRow).toHaveAttribute('data-vsphere-alert-row', 'host-alarm:incident:alarm-401:0');
+ expect(within(firstRow).getByText('lab-vcenter')).toBeInTheDocument();
+ expect(within(firstRow).getByText('host-101')).toBeInTheDocument();
- await fireEvent.click(screen.getByRole('button', { name: 'Show attention' }));
- expect(screen.getByRole('button', { name: 'Show all signals' })).toBeInTheDocument();
+ const attentionFilter = screen.getByRole('button', {
+ name: 'Attention, 1 health signal',
+ });
+ expect(attentionFilter).toHaveTextContent('Attention');
+ expect(attentionFilter).toHaveTextContent('1');
+ await fireEvent.click(attentionFilter);
+ expect(document.querySelectorAll('[data-vsphere-alert-row]')).toHaveLength(1);
+
+ await fireEvent.click(screen.getByRole('button', { name: 'All' }));
+ expect(document.querySelectorAll('[data-vsphere-alert-row]')).toHaveLength(2);
const row = screen
.getByText('Host host-101 has VMware alarm Host connection and power state (red)')