diff --git a/tests/e2e/cloud-auth.spec.ts b/tests/e2e/cloud-auth.spec.ts index b480173594d..3c43bedc229 100644 --- a/tests/e2e/cloud-auth.spec.ts +++ b/tests/e2e/cloud-auth.spec.ts @@ -28,13 +28,13 @@ for (const cloudOrigin of ["https://my.paperclip.app", "https://my-staging.paper } }).observe(document, { childList: true, subtree: true }); }); - await page.route("**/api/health", async (route) => { - const response = await route.fetch(); - await route.fulfill({ response, json: { - ...await response.json(), deploymentMode: "authenticated", bootstrapStatus: "ready", - cloud: { managed: true, managedBy: "paperclip-cloud", cloudBaseUrl: cloudOrigin, stackSlug: "test-workspace" }, - } }); - }); + const healthResponse = await request.get("/api/health"); + expect(healthResponse.ok()).toBe(true); + const cloudHealth = { + ...await healthResponse.json(), status: "ok", deploymentMode: "authenticated", bootstrapStatus: "ready", + cloud: { managed: true, managedBy: "paperclip-cloud", cloudBaseUrl: cloudOrigin, stackSlug: "test-workspace" }, + }; + await page.route("**/api/health", (route) => route.fulfill({ json: cloudHealth })); await page.route("**/api/auth/get-session", (route) => route.fulfill(authenticated ? { json: { session: { id: "test-session", userId: "local-board" }, user: { id: "local-board", email: "test@example.test", name: "Test user", image: null }, sentryDsn: null }, } : { status: 401, json: { error: "Board authentication required" } }));