From 850ba3ac9ec18a2bca74fbcdbfe7f39afa44d683 Mon Sep 17 00:00:00 2001 From: "groombook-engineer[bot]" <3141748+groombook-engineer[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:12:45 +0000 Subject: [PATCH] fix(e2e): mock /api/setup/status to prevent redirect to /setup The app's App.tsx calls /api/setup/status after auth resolution when authDisabled=true and a dev user is present. If this endpoint is not mocked, the browser's network request to the live dev API returns a 200 with needsSetup:true, triggering a redirect to /setup before the test content can render. This caused the "no services available" and "clients page" tests to fail with element not found, since the SetupWizard page was shown instead of the admin book/clients pages. Added mock for /api/setup/status in fixtures.ts returning {needsSetup:false} to match the existing mocking strategy for other dev-mode API endpoints. Co-Authored-By: Paperclip --- apps/e2e/tests/fixtures.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/e2e/tests/fixtures.ts b/apps/e2e/tests/fixtures.ts index 8e02aa4..22b510e 100644 --- a/apps/e2e/tests/fixtures.ts +++ b/apps/e2e/tests/fixtures.ts @@ -43,6 +43,10 @@ export const test = base.extend({ }, }) ); + // Mock the setup status endpoint so the app does not redirect to /setup + await page.route("**/api/setup/status", (route) => + route.fulfill({ json: { needsSetup: false } }) + ); // Seed localStorage as a fallback in case the mock is bypassed await page.addInitScript(() => { localStorage.setItem(