refactor(web): sweep 24 test files to use makeTrack/makeTracks fixtures (#375)

Replaces inline TrackRef literal redefinitions with calls to the
test-utils helper. Tests that asserted on default field values
(e.g. track titles, artist names rendered in the DOM) keep explicit
overrides; tests that only need a stub for shape now use makeTrack()
with no overrides.

PlaylistCard.test.ts, PlaylistTrackRow.test.ts, and playlist.test.ts
SKIPPED — they use PlaylistTrack (with track_id/added_at), not TrackRef.
ArtistCard.svelte and +page.svelte route files (matched by initial grep)
SKIPPED — live code, not test files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 15:58:14 -04:00
co-authored by Claude Opus 4.7
parent 993bcc6a14
commit 9b4f907db6
24 changed files with 95 additions and 202 deletions
+2 -10
View File
@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/svelte';
import QueueDrawer from './QueueDrawer.svelte';
import type { TrackRef } from '$lib/api/types';
import { makeTrack } from '$test-utils/fixtures/track';
const closeQueueDrawer = vi.fn();
let queueValue: TrackRef[] = [];
@@ -22,16 +23,7 @@ vi.mock('$lib/player/store.svelte', () => ({
moveQueueItem: vi.fn()
}));
const t = (id: string): TrackRef => ({
id,
title: `Song ${id}`,
album_id: `al-${id}`,
album_title: 'A',
artist_id: `ar-${id}`,
artist_name: `Artist ${id}`,
duration_sec: 200,
stream_url: `/stream/${id}`
});
const t = (id: string): TrackRef => makeTrack({ id, title: `Song ${id}` });
describe('QueueDrawer', () => {
beforeEach(() => {