diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-17 13:45:03 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-17 13:45:03 -0800 |
| commit | 8848259ccec2383211182d63cd87b46ba6f05a0c (patch) | |
| tree | 0088be560bed00c644e8435661c51d45f627c391 /frontend-vanilla/src/main.test.ts | |
| parent | c3b7c28c79f0db94cd09d3ba218340e8e26e1758 (diff) | |
| download | neko-8848259ccec2383211182d63cd87b46ba6f05a0c.tar.gz neko-8848259ccec2383211182d63cd87b46ba6f05a0c.tar.bz2 neko-8848259ccec2383211182d63cd87b46ba6f05a0c.zip | |
Fix feed handling: Send full feed object on update to satisfy backend requirements
Diffstat (limited to 'frontend-vanilla/src/main.test.ts')
| -rw-r--r-- | frontend-vanilla/src/main.test.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/frontend-vanilla/src/main.test.ts b/frontend-vanilla/src/main.test.ts index eb9e615..40acd83 100644 --- a/frontend-vanilla/src/main.test.ts +++ b/frontend-vanilla/src/main.test.ts @@ -371,14 +371,20 @@ describe('main application logic', () => { expect(apiFetch).toHaveBeenCalledWith('/api/feed/123', expect.objectContaining({ method: 'DELETE' })); }); - it('updateFeed should call API', async () => { + it('updateFeed should call API with merged data', async () => { + store.setFeeds([{ _id: 123, title: 'Test Feed', url: 'http://example.com' } as any]); vi.mocked(apiFetch).mockResolvedValueOnce({ ok: true } as Response); const { updateFeed } = await import('./main'); await updateFeed(123, { category: 'New Tag' }); + expect(apiFetch).toHaveBeenCalledWith('/api/feed', expect.objectContaining({ method: 'PUT', body: expect.stringContaining('"category":"New Tag"') })); + // Should verify it merged the title + expect(apiFetch).toHaveBeenCalledWith('/api/feed', expect.objectContaining({ + body: expect.stringContaining('"title":"Test Feed"') + })); }); it('renderSettings should show manage feeds section', () => { |
