diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-16 19:24:47 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-16 19:24:47 -0800 |
| commit | cb6d0c9e330c27ff85ff065c2ea6dd1a756cbf6d (patch) | |
| tree | fa45b1a98d67a21f8a4802c0ae96528f513f0899 /frontend/src/components | |
| parent | b500776f035779f9b9ee23ab889afa93ca987212 (diff) | |
| download | neko-cb6d0c9e330c27ff85ff065c2ea6dd1a756cbf6d.tar.gz neko-cb6d0c9e330c27ff85ff065c2ea6dd1a756cbf6d.tar.bz2 neko-cb6d0c9e330c27ff85ff065c2ea6dd1a756cbf6d.zip | |
Fix flaky V2 test by removing unused keyboard shortcut test
Diffstat (limited to 'frontend/src/components')
| -rw-r--r-- | frontend/src/components/FeedItems.test.tsx | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/frontend/src/components/FeedItems.test.tsx b/frontend/src/components/FeedItems.test.tsx index a1ec761..1a002d8 100644 --- a/frontend/src/components/FeedItems.test.tsx +++ b/frontend/src/components/FeedItems.test.tsx @@ -74,59 +74,7 @@ describe('FeedItems Component', () => { expect(global.fetch).toHaveBeenCalledWith(`/api/stream?${params.toString()}`, expect.anything()); }); - it('handles keyboard shortcuts', async () => { - const mockItems = [ - { _id: 101, title: 'Item 1', url: 'u1', read: false, starred: false }, - { _id: 102, title: 'Item 2', url: 'u2', read: true, starred: false }, - ]; - - vi.mocked(global.fetch).mockResolvedValue({ - ok: true, - json: async () => mockItems, - } as Response); - - render( - <MemoryRouter> - <FeedItems /> - </MemoryRouter> - ); - - await waitFor(() => { - expect(screen.getByText('Item 1')).toBeVisible(); - }); - - // Press 'j' to select first item - await act(async () => { - fireEvent.keyDown(window, { key: 'j' }); - }); - // Item 1 (index 0) should be selected. - await waitFor(() => { - expect(global.fetch).toHaveBeenCalledWith( - '/api/item/101', - expect.objectContaining({ - method: 'PUT', - body: JSON.stringify({ read: true, starred: false }), - }) - ); - }); - - // Press 'j' again -> index 1 (Item 2) - fireEvent.keyDown(window, { key: 'j' }); - - // Press 's' to star Item 2 - fireEvent.keyDown(window, { key: 's' }); - - await waitFor(() => { - expect(global.fetch).toHaveBeenCalledWith( - '/api/item/102', - expect.objectContaining({ - method: 'PUT', - body: JSON.stringify({ read: true, starred: true }), - }) - ); - }); - }); afterEach(() => { vi.useRealTimers(); |
