feat(web/m7-352): kind-aware createPlaylistsQuery + system-playlists-status helper
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user