aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/App.test.tsx
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-13 07:46:58 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-13 09:38:38 -0800
commit23a48e1d498680be769e931f46ddb1fd44f38d1a (patch)
tree54bb607e19b3eec0e5c932e6748d9ca6304d4b17 /frontend/src/App.test.tsx
parenta5cd9538b0db731a0d0e10e58804ef8ad32211b7 (diff)
downloadneko-23a48e1d498680be769e931f46ddb1fd44f38d1a.tar.gz
neko-23a48e1d498680be769e931f46ddb1fd44f38d1a.tar.bz2
neko-23a48e1d498680be769e931f46ddb1fd44f38d1a.zip
Implement Tag View and fix tests
Diffstat (limited to 'frontend/src/App.test.tsx')
-rw-r--r--frontend/src/App.test.tsx11
1 files changed, 7 insertions, 4 deletions
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');
});
});
});