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:
@@ -1,20 +1,11 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { dayBucket, groupByDay } from './dayGroup';
|
||||
import type { HistoryEvent } from '$lib/api/history';
|
||||
import type { TrackRef } from '$lib/api/types';
|
||||
import { makeTrack } from '$test-utils/fixtures/track';
|
||||
|
||||
const NOW = new Date('2026-05-04T14:00:00Z');
|
||||
|
||||
const stubTrack: TrackRef = {
|
||||
id: 'track-x',
|
||||
title: 'Song X',
|
||||
album_id: 'al-x',
|
||||
album_title: 'Album X',
|
||||
artist_id: 'ar-x',
|
||||
artist_name: 'Artist X',
|
||||
duration_sec: 200,
|
||||
stream_url: '/stream/x'
|
||||
};
|
||||
const stubTrack = makeTrack();
|
||||
|
||||
const mkEvent = (id: string, playedAt: string): HistoryEvent => ({
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user