fix(web/m7-352): update listPlaylists test URL after kind filter addition

This commit is contained in:
2026-05-04 18:52:40 -04:00
parent 5698cfe8e4
commit 412a1c00ac
+9 -2
View File
@@ -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' });