From 412a1c00ac06aff6d113fc150be91caf1709c436 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 4 May 2026 18:52:40 -0400 Subject: [PATCH] fix(web/m7-352): update listPlaylists test URL after kind filter addition --- web/src/lib/api/playlists.test.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/src/lib/api/playlists.test.ts b/web/src/lib/api/playlists.test.ts index 209f9ae8..4fe7f464 100644 --- a/web/src/lib/api/playlists.test.ts +++ b/web/src/lib/api/playlists.test.ts @@ -22,16 +22,23 @@ afterEach(() => { }); describe('playlists API helper', () => { - test('listPlaylists GETs /api/playlists', async () => { + test('listPlaylists GETs /api/playlists with default kind=user', async () => { const spy = stubFetch(200, { owned: [], public: [] }); const r = await listPlaylists(); expect(r.owned).toEqual([]); expect(r.public).toEqual([]); const call = spy.mock.calls[0]; - expect(call[0]).toBe('/api/playlists'); + expect(call[0]).toBe('/api/playlists?kind=user'); expect((call[1] as RequestInit).method).toBe('GET'); }); + test('listPlaylists passes kind=system through the query string', async () => { + const spy = stubFetch(200, { owned: [], public: [] }); + await listPlaylists('system'); + const call = spy.mock.calls[0]; + expect(call[0]).toBe('/api/playlists?kind=system'); + }); + test('createPlaylist POSTs JSON body', async () => { const spy = stubFetch(200, { id: 'p1', name: 'Test' }); const r = await createPlaylist({ name: 'Test' });