diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-14 21:11:40 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-14 21:11:40 -0800 |
| commit | d5a413382c93efeb1d888daf3216c51cd5f40f75 (patch) | |
| tree | a7d8505a0a1c90050ea6bd33c02f7e8a5b5537e5 /frontend/src/components/Settings.test.tsx | |
| parent | a7369274ba24298a0449865f147fc65253e992a2 (diff) | |
| download | neko-d5a413382c93efeb1d888daf3216c51cd5f40f75.tar.gz neko-d5a413382c93efeb1d888daf3216c51cd5f40f75.tar.bz2 neko-d5a413382c93efeb1d888daf3216c51cd5f40f75.zip | |
chore: fix lint and type errors to resolve CI failures
Diffstat (limited to 'frontend/src/components/Settings.test.tsx')
| -rw-r--r-- | frontend/src/components/Settings.test.tsx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/frontend/src/components/Settings.test.tsx b/frontend/src/components/Settings.test.tsx index b7de3bb..a0e7de4 100644 --- a/frontend/src/components/Settings.test.tsx +++ b/frontend/src/components/Settings.test.tsx @@ -18,10 +18,10 @@ describe('Settings Component', () => { { _id: 2, title: 'Gaming', url: 'http://gaming.com/rss', category: 'gaming' }, ]; - (global.fetch as any).mockResolvedValueOnce({ + vi.mocked(global.fetch).mockResolvedValueOnce({ ok: true, json: async () => mockFeeds, - }); + } as Response); render(<Settings />); @@ -33,13 +33,13 @@ describe('Settings Component', () => { }); it('adds a new feed', async () => { - (global.fetch as any) - .mockResolvedValueOnce({ ok: true, json: async () => [] }) // Initial load - .mockResolvedValueOnce({ ok: true, json: async () => ({}) }) // Add feed + vi.mocked(global.fetch) + .mockResolvedValueOnce({ ok: true, json: async () => [] } as Response) // Initial load + .mockResolvedValueOnce({ ok: true, json: async () => ({}) } as Response) // Add feed .mockResolvedValueOnce({ ok: true, json: async () => [{ _id: 3, title: 'New Feed', url: 'http://new.com/rss' }], - }); // Refresh load + } as Response); // Refresh load render(<Settings />); @@ -75,9 +75,9 @@ describe('Settings Component', () => { { _id: 1, title: 'Tech News', url: 'http://tech.com/rss', category: 'tech' }, ]; - (global.fetch as any) - .mockResolvedValueOnce({ ok: true, json: async () => mockFeeds }) // Initial load - .mockResolvedValueOnce({ ok: true }); // Delete + vi.mocked(global.fetch) + .mockResolvedValueOnce({ ok: true, json: async () => mockFeeds } as Response) // Initial load + .mockResolvedValueOnce({ ok: true } as Response); // Delete render(<Settings />); @@ -100,13 +100,13 @@ describe('Settings Component', () => { }); it('imports an OPML file', async () => { - (global.fetch as any) - .mockResolvedValueOnce({ ok: true, json: async () => [] }) // Initial load - .mockResolvedValueOnce({ ok: true, json: async () => ({ status: 'ok' }) }) // Import + vi.mocked(global.fetch) + .mockResolvedValueOnce({ ok: true, json: async () => [] } as Response) // Initial load + .mockResolvedValueOnce({ ok: true, json: async () => ({ status: 'ok' }) } as Response) // Import .mockResolvedValueOnce({ ok: true, json: async () => [{ _id: 1, title: 'Imported Feed', url: 'http://imported.com/rss' }], - }); // Refresh load + } as Response); // Refresh load render(<Settings />); |
