diff --git a/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts b/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts index 11a2af621..fbd7a71d0 100644 --- a/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts +++ b/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts @@ -298,16 +298,26 @@ describe('useWorkloads', () => { it('tracks canonical hybrid VM memory without substituting nested agent readings', async () => { // #1962: synthetic snapshots exercise Web reactivity, not poller recovery. - const buildVM = (instance: string, percent?: number) => ({ - id: `${instance}-pve1-101`, type: 'vm', name: `${instance}-vm`, - status: 'running', platformType: 'proxmox-pve', sourceType: 'hybrid', - sources: ['proxmox', 'agent'], - proxmox: { vmid: 101, nodeName: 'pve1', instance }, - memory: percent === undefined ? undefined : { - current: percent, used: percent * 1024, total: 100 * 1024, - }, - agent: { memory: { used: 35 * 1024, total: 100 * 1024, usage: 35 } }, - }) as any; + const buildVM = (instance: string, percent?: number) => + ({ + id: `${instance}-pve1-101`, + type: 'vm', + name: `${instance}-vm`, + status: 'running', + platformType: 'proxmox-pve', + sourceType: 'hybrid', + sources: ['proxmox', 'agent'], + proxmox: { vmid: 101, nodeName: 'pve1', instance }, + memory: + percent === undefined + ? undefined + : { + current: percent, + used: percent * 1024, + total: 100 * 1024, + }, + agent: { memory: { used: 35 * 1024, total: 100 * 1024, usage: 35 } }, + }) as any; const otherVM = buildVM('cluster-b', 80); const [snapshot, setSnapshot] = createSignal([buildVM('cluster-a', 100), otherVM]); let dispose = () => {};