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.

Reset sessionPresentationPolicy signal between useAppRuntimeState tests

rcourtman89a1740241df
diff --git a/frontend-modern/src/__tests__/useAppRuntimeState.test.ts b/frontend-modern/src/__tests__/useAppRuntimeState.test.ts
index 4cf36bf36f..9b317d8f2b 100644
--- a/frontend-modern/src/__tests__/useAppRuntimeState.test.ts
+++ b/frontend-modern/src/__tests__/useAppRuntimeState.test.ts
@@ -215,10 +215,19 @@ describe('useAppRuntimeState', () => {
}));
({ useAppRuntimeState } = await import('@/useAppRuntimeState'));
+
+ // Reset the freshly-imported sessionPresentationPolicy signal to its
+ // defaults so a prior test's demo-mode mutation (in this file or in a
+ // sibling that imports the same module) cannot leak into the
+ // loadOrganizations branch selection inside useAppRuntimeState.
+ const policyModule = await import('@/stores/sessionPresentationPolicy');
+ policyModule.syncSessionPresentationPolicy(null);
});
- afterEach(() => {
+ afterEach(async () => {
vi.clearAllMocks();
+ const policyModule = await import('@/stores/sessionPresentationPolicy');
+ policyModule.syncSessionPresentationPolicy(null);
vi.resetModules();
});