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.

Update stale test assertions to match canonical column order and shape

rcourtman6d2f6e8e287e
diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePoolDetailModel.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePoolDetailModel.test.ts
index e47b8c370a..06d86094ea 100644
--- a/frontend-modern/src/components/Storage/__tests__/useStoragePoolDetailModel.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/useStoragePoolDetailModel.test.ts
@@ -91,6 +91,12 @@ describe('useStoragePoolDetailModel', () => {
model: 'Disk A',
temperature: 44,
hasIssue: false,
+ errorCount: 0,
+ ioLabel: '',
+ role: '',
+ sizeLabel: '',
+ spunDown: false,
+ state: '',
},
]);
});
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 6630f33429..f7d60de18b 100644
--- a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest';
import agentsMachinesTableSource from '@/features/standalone/AgentsMachinesTable.tsx?raw';
+import agentMachineTableModelSource from '@/features/standalone/agentMachineTableModel.ts?raw';
import standalonePageModelSource from '@/features/standalone/standalonePageModel.ts?raw';
import standalonePageSurfaceSource from '@/features/standalone/StandalonePageSurface.tsx?raw';
import dockerConfigsTableSource from '@/features/docker/DockerConfigsTable.tsx?raw';
@@ -356,17 +357,23 @@ describe('platform overview layout guardrails', () => {
/getPlatformTableHeadClassForKind\('numeric-value'\)[\s\S]{0,200}?VMs/,
);
expect(vsphereHostsTableSource).toContain('hidden md:table-cell');
+ // AgentsMachinesTable uses a column-config pattern: kind helpers are
+ // applied dynamically in the table render, with labels living in the
+ // model. Assert against the model's column declarations.
expect(agentsMachinesTableSource).toMatch(
- /getPlatformTableHeadClassForKind\('name'\)[\s\S]{0,200}?Machine/,
+ /getPlatformTableHeadClassForKind\(kind\(\)\)/,
);
- expect(agentsMachinesTableSource).toMatch(
- /getPlatformTableHeadClassForKind\('metric-bar'\)[\s\S]{0,200}?CPU/,
+ expect(agentMachineTableModelSource).toMatch(
+ /id:\s*'machine'[\s\S]{0,80}?label:\s*'Machine'[\s\S]{0,80}?kind:\s*'name'/,
);
- expect(agentsMachinesTableSource).toMatch(
- /getPlatformTableHeadClassForKind\('metric-bar'\)[\s\S]{0,200}?Memory/,
+ expect(agentMachineTableModelSource).toMatch(
+ /id:\s*'cpu'[\s\S]{0,80}?label:\s*'CPU'[\s\S]{0,80}?kind:\s*'metric-bar'/,
);
- expect(agentsMachinesTableSource).toMatch(
- /getPlatformTableHeadClassForKind\('metric-bar'\)[\s\S]{0,200}?Disk/,
+ expect(agentMachineTableModelSource).toMatch(
+ /id:\s*'memory'[\s\S]{0,80}?label:\s*'Memory'[\s\S]{0,80}?kind:\s*'metric-bar'/,
+ );
+ expect(agentMachineTableModelSource).toMatch(
+ /id:\s*'disk'[\s\S]{0,80}?label:\s*'Disk'[\s\S]{0,80}?kind:\s*'metric-bar'/,
);
});
});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxHostTableModel.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxHostTableModel.test.ts
index 19778b35cb..5fad8a7ef7 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxHostTableModel.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxHostTableModel.test.ts
@@ -38,11 +38,11 @@ describe('proxmoxHostTableModel', () => {
expect(compactIds).toEqual([
'node',
'version',
- 'uptime',
'cpu',
'memory',
'disk',
'temp',
+ 'uptime',
'vms',
'cts',
'cluster',