Browse Source

Fix auth mock in tests

Add missing /api/v1/auth/status mock to MSW handlers to prevent
network errors during frontend tests
maziggy 7 months ago
parent
commit
d6dcc7656d
1 changed files with 11 additions and 0 deletions
  1. 11 0
      frontend/src/__tests__/mocks/handlers.ts

+ 11 - 0
frontend/src/__tests__/mocks/handlers.ts

@@ -269,6 +269,17 @@ export const handlers = [
     return HttpResponse.json(body);
   }),
 
+  // ========================================================================
+  // Auth
+  // ========================================================================
+
+  http.get('/api/v1/auth/status', () => {
+    return HttpResponse.json({
+      auth_enabled: false,
+      requires_setup: false,
+    });
+  }),
+
   // ========================================================================
   // Version / Health
   // ========================================================================