fix(e2e): add dev/config, dev/users, and branding mocks to navigation.spec.ts

Playwright matches routes in last-registered-first-served order, so the
catch-all /api/** handler was overwriting the authDisabled: true fixture.
Added specific handlers before the catch-all to ensure auth config,
user list, and branding responses are properly shaped.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Paperclip
2026-03-27 22:33:40 +00:00
parent 982d6e87b7
commit 149465a16a
+9
View File
@@ -10,6 +10,15 @@ test.beforeEach(async ({ page }) => {
// Reports endpoints need shaped responses (not bare []) to avoid render crashes.
await page.route("/api/**", (route) => {
const url = route.request().url();
if (url.includes("/api/dev/config")) {
return route.fulfill({ json: { authDisabled: true } });
}
if (url.includes("/api/dev/users")) {
return route.fulfill({ json: { staff: [], clients: [] } });
}
if (url.includes("/api/branding")) {
return route.fulfill({ json: { businessName: "GroomBook", logoUrl: null, theme: "default" } });
}
if (url.includes("/api/reports/summary")) {
return route.fulfill({
json: {