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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user