0}>
- {props.model().summary.runningGuestCount} running
+ {currentModel().summary.runningGuestCount} running
- 0}>
+ 0}>
|
- {props.model().summary.degradedGuestCount} attention
+ {currentModel().summary.degradedGuestCount} attention
|
- {props.model().summary.stoppedGuestCount} stopped
+ {currentModel().summary.stoppedGuestCount} stopped
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
index 8ab8564d3..0e3525ab2 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
@@ -43,6 +43,15 @@ const setResources = (resources: Resource[]) => {
});
};
+const setResourcesSnapshot = (resources: Resource[] | undefined, loading = false) => {
+ mockUseUnifiedResources.mockReturnValue({
+ resources: () => resources as Resource[],
+ loading: () => loading,
+ error: () => null,
+ refetch: vi.fn(),
+ });
+};
+
vi.mock('@/hooks/useUnifiedResources', () => ({
useUnifiedResources: (...args: unknown[]) => mockUseUnifiedResources(...args),
}));
@@ -266,6 +275,16 @@ describe('ProxmoxPageSurface contract', () => {
).not.toBeInTheDocument();
});
+ it('does not crash when Patrol state refreshes before Proxmox resources hydrate', async () => {
+ setResourcesSnapshot(undefined, true);
+
+ render(() =>