From 8848259ccec2383211182d63cd87b46ba6f05a0c Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Tue, 17 Feb 2026 13:45:03 -0800 Subject: Fix feed handling: Send full feed object on update to satisfy backend requirements --- frontend-vanilla/src/main.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'frontend-vanilla/src/main.test.ts') 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', () => { -- cgit v1.2.3