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.

Stabilize multi-tenant integration org reloads

rcourtman1a160eca444e
diff --git a/tests/integration/tests/03-multi-tenant.spec.ts b/tests/integration/tests/03-multi-tenant.spec.ts
index 2844196580..4d45371c34 100644
--- a/tests/integration/tests/03-multi-tenant.spec.ts
+++ b/tests/integration/tests/03-multi-tenant.spec.ts
@@ -7,6 +7,7 @@ import {
E2E_CREDENTIALS,
isMultiTenantEnabled,
switchOrg,
+ waitForAppShell,
} from './helpers';
type Organization = {
@@ -84,8 +85,8 @@ test.describe('Multi-tenant E2E flows', () => {
const created = await createOrg(page, `E2E Visibility Org ${Date.now()}`);
tempOrgID = created.id;
- await page.reload();
- await page.waitForLoadState('domcontentloaded');
+ await page.reload({ waitUntil: 'domcontentloaded' });
+ await waitForAppShell(page);
await expect(page.getByLabel('Organization')).toBeVisible();
} else {
diff --git a/tests/integration/tests/helpers.ts b/tests/integration/tests/helpers.ts
index d28d5afbbb..22f27e9926 100644
--- a/tests/integration/tests/helpers.ts
+++ b/tests/integration/tests/helpers.ts
@@ -121,7 +121,7 @@ const persistRuntimePrimaryAPIToken = (token: string) => {
}
};
-async function waitForAppShell(page: Page, timeoutMs = 20_000) {
+export async function waitForAppShell(page: Page, timeoutMs = 20_000) {
await page.waitForLoadState("domcontentloaded");
// The raw HTML shell contains a noscript fallback. Wait for the SPA to
@@ -1311,8 +1311,8 @@ export async function switchOrg(page: Page, orgId: string): Promise<void> {
window.localStorage.setItem("pulse_org_id", id);
document.cookie = `pulse_org_id=${encodeURIComponent(id)}; Path=/; SameSite=Lax`;
}, orgId);
- await page.reload();
- await page.waitForLoadState("networkidle");
+ await page.reload({ waitUntil: "domcontentloaded" });
+ await waitForAppShell(page);
}
/**