// Default empty-LikedIds mock for $lib/api/likes. Mirrors the
// TanStack Query readable shape (data + isPending + isError) that
// 19 test files were duplicating verbatim.
//
// Usage:
//   vi.mock('$lib/api/likes', () => emptyLikesMock());
//
// Tests that assert on liked-state changes (LikeButton.test.ts) keep
// their state-driven mocks inline.

import { readable } from 'svelte/store';
import { vi } from 'vitest';

export function emptyLikesMock() {
  return {
    createLikedIdsQuery: () =>
      readable({
        data: { track_ids: [], album_ids: [], artist_ids: [] },
        isPending: false,
        isError: false
      }),
    likeEntity: vi.fn().mockResolvedValue(undefined),
    unlikeEntity: vi.fn().mockResolvedValue(undefined)
  };
}
