fix(web): add player stub to player-store mocks for TrackRow tests

#401 introduced player.current?.id reads into TrackRow.svelte and
PlaylistTrackRow.svelte, breaking 26 test cases across 6 files whose
existing vi.mock('$lib/player/store.svelte', ...) blocks only stubbed
the functions used by the original components.

Added player: { current: undefined } to each affected mock — keeps
the existing function spies and lets the new isCurrent derivation
read a defined (false-y) player.current without blowing up.

Only updated the 6 files that failed; 16 other player-store mocks
exist across the suite but their tests don't render Track/Playlist
rows so the derivation never fires. Future tests that render those
rows will need the same stub (visible at the failure point with a
clear error message).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 15:05:59 -04:00
parent 3e52ff7fa3
commit efa52484d4
6 changed files with 12 additions and 6 deletions
@@ -30,7 +30,8 @@ vi.mock('$lib/player/store.svelte', () => ({
playQueue: vi.fn(),
enqueueTracks: vi.fn(),
playNext: vi.fn(),
enqueueTrack: vi.fn()
enqueueTrack: vi.fn(),
player: { current: undefined }
}));
// Cascade through PlaylistTrackRow's mocks (LikeButton + TrackMenu transitively).