aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/components/TagView.test.tsx
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 21:11:40 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 21:11:40 -0800
commitd5a413382c93efeb1d888daf3216c51cd5f40f75 (patch)
treea7d8505a0a1c90050ea6bd33c02f7e8a5b5537e5 /frontend/src/components/TagView.test.tsx
parenta7369274ba24298a0449865f147fc65253e992a2 (diff)
downloadneko-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/TagView.test.tsx')
-rw-r--r--frontend/src/components/TagView.test.tsx25
1 files changed, 16 insertions, 9 deletions
diff --git a/frontend/src/components/TagView.test.tsx b/frontend/src/components/TagView.test.tsx
index 8f7eb86..16fdee7 100644
--- a/frontend/src/components/TagView.test.tsx
+++ b/frontend/src/components/TagView.test.tsx
@@ -17,25 +17,31 @@ describe('Tag View Integration', () => {
];
const mockTags = [{ title: 'Tech' }, { title: 'News' }];
- (global.fetch as any).mockImplementation((url: string) => {
- if (url.includes('/api/feed/')) {
+ vi.mocked(global.fetch).mockImplementation((url) => {
+ const urlStr = url.toString();
+ if (urlStr.includes('/api/feed/')) {
return Promise.resolve({
ok: true,
json: async () => mockFeeds,
- });
+ } as Response);
}
- if (url.includes('/api/tag')) {
+ if (urlStr.includes('/api/tag')) {
return Promise.resolve({
ok: true,
json: async () => mockTags,
- });
+ } as Response);
}
return Promise.reject(new Error(`Unknown URL: ${url}`));
});
render(
<MemoryRouter>
- <FeedList theme="light" setTheme={() => { }} />
+ <FeedList
+ theme="light"
+ setTheme={() => { }}
+ setSidebarVisible={() => { }}
+ isMobile={false}
+ />
</MemoryRouter>
);
@@ -55,12 +61,13 @@ describe('Tag View Integration', () => {
{ _id: 101, title: 'Tag Item 1', url: 'http://example.com/1', feed_title: 'Feed 1' },
];
- (global.fetch as any).mockImplementation((url: string) => {
- if (url.includes('/api/stream')) {
+ vi.mocked(global.fetch).mockImplementation((url) => {
+ const urlStr = url.toString();
+ if (urlStr.includes('/api/stream')) {
return Promise.resolve({
ok: true,
json: async () => mockItems,
- });
+ } as Response);
}
return Promise.reject(new Error(`Unknown URL: ${url}`));
});