aboutsummaryrefslogtreecommitdiffstats
path: root/frontend-vanilla/src/main.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend-vanilla/src/main.test.ts')
-rw-r--r--frontend-vanilla/src/main.test.ts8
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', () => {