From 23a48e1d498680be769e931f46ddb1fd44f38d1a Mon Sep 17 00:00:00 2001
From: Adam Mathes <adam@adammathes.com>
Date: Fri, 13 Feb 2026 07:46:58 -0800
Subject: Implement Tag View and fix tests

---
 frontend/src/App.test.tsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'frontend/src/App.test.tsx')

diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx
index 5614d7d..d0c31fd 100644
--- a/frontend/src/App.test.tsx
+++ b/frontend/src/App.test.tsx
@@ -20,9 +20,12 @@ describe('App', () => {
     });
 
     it('renders dashboard when authenticated', async () => {
-        (global.fetch as any)
-            .mockResolvedValueOnce({ ok: true }) // /api/auth
-            .mockResolvedValueOnce({ ok: true, json: async () => [] }); // /api/feed/
+        (global.fetch as any).mockImplementation((url: string) => {
+            if (url.includes('/api/auth')) return Promise.resolve({ ok: true });
+            if (url.includes('/api/feed/')) return Promise.resolve({ ok: true, json: async () => [] });
+            if (url.includes('/api/tag')) return Promise.resolve({ ok: true, json: async () => [] });
+            return Promise.resolve({ ok: true }); // Fallback
+        });
 
         window.history.pushState({}, 'Test page', '/v2/');
         render(<App />);
@@ -47,7 +50,7 @@ describe('App', () => {
 
         await waitFor(() => {
             expect(global.fetch).toHaveBeenCalledWith('/api/logout', expect.objectContaining({ method: 'POST' }));
-            expect(window.location.href).toBe('/login/');
+            expect(window.location.href).toBe('/v2/login');
         });
     });
 });
-- 
cgit v1.2.3

