feat(web/m7-352): kind-aware createPlaylistsQuery + system-playlists-status helper

This commit is contained in:
2026-05-04 18:30:43 -04:00
parent 56f0998f84
commit 886903ae27
4 changed files with 57 additions and 7 deletions
+21
View File
@@ -0,0 +1,21 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { getSystemPlaylistsStatus } from './me';
vi.mock('./client', () => ({
api: { get: vi.fn() }
}));
import { api } from './client';
describe('me API', () => {
beforeEach(() => vi.clearAllMocks());
it('getSystemPlaylistsStatus GETs the correct path', async () => {
(api.get as unknown as ReturnType<typeof vi.fn>).mockResolvedValueOnce({
in_flight: false, last_run_at: null, last_error: null
});
const got = await getSystemPlaylistsStatus();
expect(api.get).toHaveBeenCalledWith('/api/me/system-playlists-status');
expect(got.in_flight).toBe(false);
});
});