test: invented artists, albums and MusicBrainz ids in place of real ones
release / web (push) Failing after 1m16s
release / go (push) Successful in 1m48s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m0s
release / android (push) Successful in 4m34s
release / Build signed APK (push) Successful in 5m9s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Test data and example comments named real artists, records and songs, and
carried real MusicBrainz ids. One mapping swaps them for invented ones
throughout (Fields of Ontario, Plastic Apes, Marlo Davies, ...), keeping
what each case tests: sort order, index letter, escaping, title keys,
artist-prefix stripping. A test username is no longer the operator's name.

The cover-art and Last.fm connection checks still query real releases;
they reach live services and need something that exists there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:21:34 -05:00
co-authored by Claude Opus 5.5
parent 4244d81dfd
commit 4e1807cbba
80 changed files with 570 additions and 570 deletions
+6 -6
View File
@@ -29,9 +29,9 @@ beforeEach(() => {
const baseQuarantineRow: AdminQuarantineRow = {
track_id: 't1',
track_title: 'Avril 14th',
artist_name: 'Aphex Twin',
album_title: 'Drukqs',
track_title: 'Juin 21st',
artist_name: 'Apex Sibling',
album_title: 'Drumkits',
album_id: 'alb1',
report_count: 1,
latest_at: '2026-01-01T00:00:00Z',
@@ -47,9 +47,9 @@ const baseAction: ActionResult = {
const baseActionRow: QuarantineActionRow = {
id: 'a1',
track_id: 't1',
track_title: 'Avril 14th',
artist_name: 'Aphex Twin',
album_title: 'Drukqs',
track_title: 'Juin 21st',
artist_name: 'Apex Sibling',
album_title: 'Drumkits',
action: 'resolved',
admin_id: 'admin1',
affected_users: 1,
+3 -3
View File
@@ -31,13 +31,13 @@ const mockMineRow: QuarantineMineRow = {
reason: 'bad_rip',
notes: null,
created_at: '2026-01-01T00:00:00Z',
track_title: 'Avril 14th',
track_title: 'Juin 21st',
track_duration_ms: 120000,
album_id: 'alb1',
album_title: 'Drukqs',
album_title: 'Drumkits',
album_cover_art_path: null,
artist_id: 'art1',
artist_name: 'Aphex Twin'
artist_name: 'Apex Sibling'
};
beforeEach(() => {
+4 -4
View File
@@ -150,9 +150,9 @@ describe("AcoustIDCard", () => {
vi.mocked(listUnsettledAcoustID).mockResolvedValue([
{
track_id: "t1",
title: "WWW",
artist: "Moe Shop",
album: "WWW",
title: "XYZ",
artist: "Mochi Shop",
album: "XYZ",
file_path: "/music/a.mp3",
state: "ambiguous",
best_score: 0.97,
@@ -168,7 +168,7 @@ describe("AcoustIDCard", () => {
details.open = true;
await fireEvent(details, new Event("toggle"));
const list = await screen.findByTestId("acoustid-unsettled");
expect(list.textContent).toMatch(/WWW/);
expect(list.textContent).toMatch(/XYZ/);
expect(list.textContent).toMatch(/2 recordings/);
});
+14 -14
View File
@@ -39,10 +39,10 @@ import { enqueueTracks, playQueue } from '#lib/player/store.svelte.js';
const album: AlbumRef = {
id: 'xyz',
title: 'Kind of Blue',
sort_title: 'Kind of Blue',
artist_id: 'm-davis',
artist_name: 'Miles Davis',
title: 'Kind of Grey',
sort_title: 'Kind of Grey',
artist_id: 'm-davies',
artist_name: 'Marlo Davies',
year: 1959,
track_count: 5,
duration_sec: 2630,
@@ -57,8 +57,8 @@ describe('AlbumCard', () => {
const { container } = render(AlbumCard, { props: { album } });
const link = screen.getByRole('link');
expect(link).toHaveAttribute('href', '/albums/xyz');
expect(link).toHaveTextContent('Kind of Blue');
expect(link).toHaveTextContent('Miles Davis');
expect(link).toHaveTextContent('Kind of Grey');
expect(link).toHaveTextContent('Marlo Davies');
// The year is intentionally omitted from the Home tile —
// dropped in the visual polish pass; the album detail page
// still shows it.
@@ -85,9 +85,9 @@ describe('AlbumCard', () => {
test('+ queue button fetches album detail and calls enqueueTracks', async () => {
const tracks: TrackRef[] = [
makeTrack({
title: 'So What',
album_id: 'xyz', album_title: 'Kind of Blue',
artist_id: 'm-davis', artist_name: 'Miles Davis',
title: 'So Then',
album_id: 'xyz', album_title: 'Kind of Grey',
artist_id: 'm-davies', artist_name: 'Marlo Davies',
duration_sec: 545
})
];
@@ -106,9 +106,9 @@ describe('AlbumCard', () => {
test('play overlay click fetches album detail and calls playQueue at index 0', async () => {
const tracks: TrackRef[] = [
makeTrack({
title: 'So What',
album_id: 'xyz', album_title: 'Kind of Blue',
artist_id: 'm-davis', artist_name: 'Miles Davis',
title: 'So Then',
album_id: 'xyz', album_title: 'Kind of Grey',
artist_id: 'm-davies', artist_name: 'Marlo Davies',
duration_sec: 545
})
];
@@ -116,7 +116,7 @@ describe('AlbumCard', () => {
(api.get as ReturnType<typeof vi.fn>).mockResolvedValueOnce(detail);
render(AlbumCard, { props: { album } });
await fireEvent.click(screen.getByRole('button', { name: /play kind of blue/i }));
await fireEvent.click(screen.getByRole('button', { name: /play kind of grey/i }));
expect(api.get).toHaveBeenCalledWith('/api/albums/xyz');
await Promise.resolve();
await Promise.resolve();
@@ -125,6 +125,6 @@ describe('AlbumCard', () => {
test('renders the bottom-right kebab menu trigger', () => {
render(AlbumCard, { props: { album } });
expect(screen.getByRole('button', { name: /Album actions for Kind of Blue/i })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Album actions for Kind of Grey/i })).toBeInTheDocument();
});
});
+8 -8
View File
@@ -20,8 +20,8 @@ import { playQueue } from '#lib/player/store.svelte.js';
const artist: ArtistRef = {
id: 'art-1',
name: 'Boards of Canada',
sort_name: 'Boards of Canada',
name: 'Fields of Ontario',
sort_name: 'Fields of Ontario',
album_count: 5,
cover_url: '/api/albums/cov-1/cover'
};
@@ -48,13 +48,13 @@ describe('ArtistCard', () => {
test('play overlay fetches tracks, shuffles, calls playQueue', async () => {
const tracks: TrackRef[] = makeTracks(2, {
album_id: 'al-1', album_title: 'X',
artist_id: 'art-1', artist_name: 'BoC',
artist_id: 'art-1', artist_name: 'FoO',
duration_sec: 1
});
(api.get as ReturnType<typeof vi.fn>).mockResolvedValueOnce(tracks);
render(ArtistCard, { props: { artist } });
await fireEvent.click(screen.getByRole('button', { name: /play boards of canada/i }));
await fireEvent.click(screen.getByRole('button', { name: /play fields of ontario/i }));
expect(api.get).toHaveBeenCalledWith('/api/artists/art-1/tracks');
await Promise.resolve();
await Promise.resolve();
@@ -70,22 +70,22 @@ describe('ArtistCard', () => {
// Like button (LikeButton's aria-label is dynamic Like|Unlike).
expect(screen.getByRole('button', { name: /^(Like|Unlike)$/ })).toBeInTheDocument();
// Add-to-queue button.
expect(screen.getByRole('button', { name: /Add Boards of Canada to queue/i })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Add Fields of Ontario to queue/i })).toBeInTheDocument();
});
test('renders the bottom-right kebab', () => {
render(ArtistCard, { props: { artist } });
expect(screen.getByRole('button', { name: /Artist actions for Boards of Canada/i })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Artist actions for Fields of Ontario/i })).toBeInTheDocument();
});
test('+queue button calls listArtistTracks then enqueueTracks', async () => {
const fakeTracks = [
makeTrack({ artist_id: 'art-1', artist_name: 'BoC' })
makeTrack({ artist_id: 'art-1', artist_name: 'FoO' })
];
const { listArtistTracks } = await import('#lib/api/artists.js');
(listArtistTracks as unknown as ReturnType<typeof vi.fn>).mockResolvedValueOnce(fakeTracks);
render(ArtistCard, { props: { artist } });
const btn = screen.getByRole('button', { name: /Add Boards of Canada to queue/i });
const btn = screen.getByRole('button', { name: /Add Fields of Ontario to queue/i });
await fireEvent.click(btn);
// Allow promise microtask to flush.
await new Promise((r) => setTimeout(r, 0));
@@ -39,7 +39,7 @@ function item(over: Partial<NotificationItem> = {}): NotificationItem {
id: 'n1',
kind: 'new_music',
title: 'New album',
body: 'Boards of Canada – Geogaddi is in the library.',
body: 'Fields of Ontario – Geomantic is in the library.',
link: '/albums/al-1',
created_at: new Date().toISOString(),
read_at: null,
@@ -95,7 +95,7 @@ describe('NotificationBell', () => {
test('lists each kind with the server-rendered title and body, unread marked', async () => {
setInbox([
item({ id: 'a', kind: 'new_music', title: 'New album', body: 'Geogaddi is in the library.' }),
item({ id: 'a', kind: 'new_music', title: 'New album', body: 'Geomantic is in the library.' }),
item({
id: 'b',
kind: 'tracks_missing',
@@ -111,7 +111,7 @@ describe('NotificationBell', () => {
const rows = screen.getAllByTestId('notification-item');
expect(rows).toHaveLength(2);
expect(rows[0]).toHaveTextContent('New album');
expect(rows[0]).toHaveTextContent('Geogaddi is in the library.');
expect(rows[0]).toHaveTextContent('Geomantic is in the library.');
expect(rows[0]).toHaveAttribute('data-unread', 'true');
expect(rows[1]).toHaveTextContent('4 tracks went missing');
expect(rows[1]).not.toHaveAttribute('data-unread');
+5 -5
View File
@@ -59,9 +59,9 @@ import {
function track(): TrackRef {
return makeTrack({
title: 'So What',
album_id: 'xyz', album_title: 'Kind of Blue',
artist_id: 'md', artist_name: 'Miles Davis',
title: 'So Then',
album_id: 'xyz', album_title: 'Kind of Grey',
artist_id: 'md', artist_name: 'Marlo Davies',
duration_sec: 545
});
}
@@ -94,10 +94,10 @@ afterEach(() => vi.clearAllMocks());
describe('PlayerBar', () => {
test('renders title, artist, and cover linked to /now-playing', () => {
render(PlayerBar);
expect(compact().getByText('So What')).toBeInTheDocument();
expect(compact().getByText('So Then')).toBeInTheDocument();
// The artist label sits under the title in compact (no link wrapper);
// look for it as plain text.
expect(compact().getByText('Miles Davis')).toBeInTheDocument();
expect(compact().getByText('Marlo Davies')).toBeInTheDocument();
// Cover + title area links to /now-playing (Spotify/YouTube Music
// pattern). Album reachable via the album-name link inside NowPlaying.
const cover = compact().getByRole('link', { name: /open now playing/i });
+11 -11
View File
@@ -36,9 +36,9 @@ const live: PlaylistTrack = {
track_id: 't-1',
album_id: 'a-1',
artist_id: 'ar-1',
title: 'Roygbiv',
artist_name: 'Boards of Canada',
album_title: 'MHTRTC',
title: 'Prismatic',
artist_name: 'Fields of Ontario',
album_title: 'MHTRTW',
duration_sec: 137,
stream_url: '/api/tracks/t-1/stream',
added_at: '',
@@ -69,7 +69,7 @@ describe('PlaylistTrackRow', () => {
render(PlaylistTrackRow, {
props: { row: live, isOwner: true, onRemove: vi.fn(), onPlay: vi.fn() }
});
expect(screen.getByText('Roygbiv')).toBeInTheDocument();
expect(screen.getByText('Prismatic')).toBeInTheDocument();
expect(screen.getByText('2:17')).toBeInTheDocument();
});
@@ -79,7 +79,7 @@ describe('PlaylistTrackRow', () => {
});
expect(screen.getByLabelText(/reorder track/i)).toBeInTheDocument();
expect(
screen.getByLabelText(/Remove Roygbiv from playlist/i)
screen.getByLabelText(/Remove Prismatic from playlist/i)
).toBeInTheDocument();
});
@@ -89,7 +89,7 @@ describe('PlaylistTrackRow', () => {
});
expect(screen.queryByLabelText(/reorder track/i)).not.toBeInTheDocument();
expect(
screen.queryByLabelText(/Remove Roygbiv from playlist/i)
screen.queryByLabelText(/Remove Prismatic from playlist/i)
).not.toBeInTheDocument();
});
@@ -117,7 +117,7 @@ describe('PlaylistTrackRow', () => {
render(PlaylistTrackRow, {
props: { row: removed, isOwner: true, onRemove: vi.fn(), onPlay: vi.fn() }
});
const titleEl = screen.getByText('Roygbiv');
const titleEl = screen.getByText('Prismatic');
expect(titleEl.className).toContain('line-through');
});
@@ -126,7 +126,7 @@ describe('PlaylistTrackRow', () => {
render(PlaylistTrackRow, {
props: { row: live, isOwner: true, onRemove: vi.fn(), onPlay }
});
await fireEvent.click(screen.getByText('Roygbiv'));
await fireEvent.click(screen.getByText('Prismatic'));
expect(onPlay).toHaveBeenCalledWith(2);
});
@@ -137,7 +137,7 @@ describe('PlaylistTrackRow', () => {
props: { row: missingFile, isOwner: true, onRemove: vi.fn(), onPlay: vi.fn() }
});
expect(screen.getByText(/file missing/i)).toBeTruthy();
expect(screen.getByText('Roygbiv').className).not.toContain('line-through');
expect(screen.getByText('Prismatic').className).not.toContain('line-through');
});
test('clicking a missing-file row does not play it', async () => {
@@ -145,7 +145,7 @@ describe('PlaylistTrackRow', () => {
render(PlaylistTrackRow, {
props: { row: missingFile, isOwner: true, onRemove: vi.fn(), onPlay }
});
await fireEvent.click(screen.getByText('Roygbiv'));
await fireEvent.click(screen.getByText('Prismatic'));
expect(onPlay).not.toHaveBeenCalled();
});
@@ -154,6 +154,6 @@ describe('PlaylistTrackRow', () => {
render(PlaylistTrackRow, {
props: { row: missingFile, isOwner: true, onRemove: vi.fn(), onPlay: vi.fn() }
});
expect(screen.getByLabelText(/remove roygbiv from playlist/i)).toBeTruthy();
expect(screen.getByLabelText(/remove prismatic from playlist/i)).toBeTruthy();
});
});
+12 -12
View File
@@ -21,15 +21,15 @@ vi.mock('#lib/api/quarantine.js', () => emptyQuarantineMock());
import TrackListRow from './TrackListRow.svelte';
import { enqueueTrack, playRadio } from '#lib/player/store.svelte.js';
const track = makeTrack({ id: 't1', title: 'Roygbiv', duration_sec: 137 });
const track = makeTrack({ id: 't1', title: 'Prismatic', duration_sec: 137 });
function base(overrides: Record<string, unknown> = {}) {
return {
title: 'Roygbiv',
subtitle: 'Boards of Canada · MHTRTC',
title: 'Prismatic',
subtitle: 'Fields of Ontario · MHTRTW',
durationSec: 137,
track,
ariaLabel: 'Roygbiv',
ariaLabel: 'Prismatic',
onActivate: vi.fn(),
...overrides
};
@@ -43,19 +43,19 @@ afterEach(() => {
describe('TrackListRow', () => {
test('draws title, subtitle and duration', () => {
render(TrackListRow, { props: base() });
expect(screen.getByText('Roygbiv')).toBeInTheDocument();
expect(screen.getByText('Boards of Canada · MHTRTC')).toBeInTheDocument();
expect(screen.getByText('Prismatic')).toBeInTheDocument();
expect(screen.getByText('Fields of Ontario · MHTRTW')).toBeInTheDocument();
expect(screen.getByText('2:17')).toBeInTheDocument();
});
test('a plain row is striped; the now-playing row is banded instead', () => {
const { unmount } = render(TrackListRow, { props: base() });
expect(screen.getByRole('button', { name: 'Roygbiv' }).className).toContain('odd:bg-surface/50');
expect(screen.getByRole('button', { name: 'Prismatic' }).className).toContain('odd:bg-surface/50');
unmount();
player.current = { id: 't1' };
render(TrackListRow, { props: base() });
const row = screen.getByRole('button', { name: 'Roygbiv' });
const row = screen.getByRole('button', { name: 'Prismatic' });
expect(row.className).toContain('border-l-accent');
expect(row.className).not.toContain('odd:bg-surface/50');
});
@@ -63,7 +63,7 @@ describe('TrackListRow', () => {
test('click and Enter activate the row', async () => {
const props = base();
render(TrackListRow, { props });
const row = screen.getByRole('button', { name: 'Roygbiv' });
const row = screen.getByRole('button', { name: 'Prismatic' });
await fireEvent.click(row);
await fireEvent.keyDown(row, { key: 'Enter' });
expect(props.onActivate).toHaveBeenCalledTimes(2);
@@ -74,7 +74,7 @@ describe('TrackListRow', () => {
test('Enter on an inner control does not activate the row', async () => {
const props = base();
render(TrackListRow, { props });
await fireEvent.keyDown(screen.getByRole('button', { name: /add roygbiv to queue/i }), { key: 'Enter' });
await fireEvent.keyDown(screen.getByRole('button', { name: /add prismatic to queue/i }), { key: 'Enter' });
expect(props.onActivate).not.toHaveBeenCalled();
});
@@ -82,7 +82,7 @@ describe('TrackListRow', () => {
const props = base();
render(TrackListRow, { props });
await fireEvent.click(screen.getByRole('button', { name: /play radio/i }));
await fireEvent.click(screen.getByRole('button', { name: /add roygbiv to queue/i }));
await fireEvent.click(screen.getByRole('button', { name: /add prismatic to queue/i }));
expect(playRadio).toHaveBeenCalledWith('t1');
expect(enqueueTrack).toHaveBeenCalledWith(track);
expect(props.onActivate).not.toHaveBeenCalled();
@@ -98,7 +98,7 @@ describe('TrackListRow', () => {
test('a disabled row does not activate', async () => {
const props = base({ disabled: true });
render(TrackListRow, { props });
await fireEvent.click(screen.getByRole('button', { name: 'Roygbiv' }));
await fireEvent.click(screen.getByRole('button', { name: 'Prismatic' }));
expect(props.onActivate).not.toHaveBeenCalled();
});
});
+2 -2
View File
@@ -36,7 +36,7 @@ vi.mock('#lib/player/store.svelte.js', () => ({
import TrackMenu from './TrackMenu.svelte';
import { playNext, enqueueTrack, playRadio } from '#lib/player/store.svelte.js';
const track = makeTrack({ title: 'Roygbiv' });
const track = makeTrack({ title: 'Prismatic' });
afterEach(() => {
vi.clearAllMocks();
@@ -46,7 +46,7 @@ afterEach(() => {
describe('TrackMenu', () => {
test('kebab toggles aria-expanded', async () => {
render(TrackMenu, { props: { track } });
const kebab = screen.getByRole('button', { name: /track actions for roygbiv/i });
const kebab = screen.getByRole('button', { name: /track actions for prismatic/i });
expect(kebab.getAttribute('aria-expanded')).toBe('false');
await fireEvent.click(kebab);
expect(kebab.getAttribute('aria-expanded')).toBe('true');
+13 -13
View File
@@ -21,8 +21,8 @@ import { playQueue, enqueueTrack, playRadio } from '#lib/player/store.svelte.js'
import { selection, clearSelection } from '#lib/selection/store.svelte.js';
const tracks: TrackRef[] = [
makeTrack({ title: 'So What', duration_sec: 545 }),
makeTrack({ id: 't2', title: 'Freddie Freeloader', track_number: 2, duration_sec: 565, stream_url: '/api/tracks/t2/stream' })
makeTrack({ title: 'So Then', duration_sec: 545 }),
makeTrack({ id: 't2', title: 'Freddie Freewheeler', track_number: 2, duration_sec: 565, stream_url: '/api/tracks/t2/stream' })
];
beforeEach(() => clearSelection());
@@ -32,7 +32,7 @@ describe('TrackRow', () => {
test('renders track number, title, formatted duration', () => {
render(TrackRow, { props: { tracks, index: 0 } });
expect(screen.getByText('1')).toBeInTheDocument();
expect(screen.getByText('So What')).toBeInTheDocument();
expect(screen.getByText('So Then')).toBeInTheDocument();
expect(screen.getByText('9:05')).toBeInTheDocument();
});
@@ -44,26 +44,26 @@ describe('TrackRow', () => {
test('clicking the row calls playQueue(tracks, index)', async () => {
render(TrackRow, { props: { tracks, index: 1 } });
await fireEvent.click(screen.getByRole('button', { name: 'Freddie Freeloader' }));
await fireEvent.click(screen.getByRole('button', { name: 'Freddie Freewheeler' }));
expect(playQueue).toHaveBeenCalledWith(tracks, 1);
});
test('Enter on the row activates play', async () => {
render(TrackRow, { props: { tracks, index: 0 } });
await fireEvent.keyDown(screen.getByRole('button', { name: 'So What' }), { key: 'Enter' });
await fireEvent.keyDown(screen.getByRole('button', { name: 'So Then' }), { key: 'Enter' });
expect(playQueue).toHaveBeenCalledWith(tracks, 0);
});
test('Space on the row activates play', async () => {
render(TrackRow, { props: { tracks, index: 0 } });
await fireEvent.keyDown(screen.getByRole('button', { name: 'So What' }), { key: ' ' });
await fireEvent.keyDown(screen.getByRole('button', { name: 'So Then' }), { key: ' ' });
expect(playQueue).toHaveBeenCalledWith(tracks, 0);
});
test('onPlay prop overrides default playQueue', async () => {
const onPlay = vi.fn();
render(TrackRow, { props: { tracks, index: 1, onPlay } });
await fireEvent.click(screen.getByRole('button', { name: 'Freddie Freeloader' }));
await fireEvent.click(screen.getByRole('button', { name: 'Freddie Freewheeler' }));
expect(onPlay).toHaveBeenCalledWith(tracks, 1);
expect(playQueue).not.toHaveBeenCalled();
});
@@ -93,7 +93,7 @@ describe('TrackRow', () => {
test('a missing file is marked, does not play, and offers no actions', async () => {
const withMissing = [{ ...tracks[0], unavailable: true }, tracks[1]];
render(TrackRow, { props: { tracks: withMissing, index: 0 } });
const row = screen.getByRole('button', { name: 'So What' });
const row = screen.getByRole('button', { name: 'So Then' });
expect(row).toHaveAttribute('aria-disabled', 'true');
expect(screen.getByText(/file missing/i)).toBeInTheDocument();
await fireEvent.click(row);
@@ -106,7 +106,7 @@ describe('TrackRow', () => {
describe('selection mode', () => {
test('clicking the checkbox toggles selection without playing', async () => {
render(TrackRow, { props: { tracks, index: 0 } });
const box = screen.getByRole('checkbox', { name: /select so what/i });
const box = screen.getByRole('checkbox', { name: /select so then/i });
await fireEvent.click(box);
expect(selection.isSelected('t1')).toBe(true);
expect(playQueue).not.toHaveBeenCalled();
@@ -114,12 +114,12 @@ describe('TrackRow', () => {
test('row click toggles selection (not play) once any row is selected', async () => {
render(TrackRow, { props: { tracks, index: 0 } });
const box = screen.getByRole('checkbox', { name: /select so what/i });
const box = screen.getByRole('checkbox', { name: /select so then/i });
await fireEvent.click(box);
// Re-render at index 1 — selection mode is now active globally.
const { container } = render(TrackRow, { props: { tracks, index: 1 } });
const row = container.querySelector('[role="button"][aria-label="Freddie Freeloader"]')!;
const row = container.querySelector('[role="button"][aria-label="Freddie Freewheeler"]')!;
await fireEvent.click(row);
expect(selection.isSelected('t2')).toBe(true);
expect(playQueue).not.toHaveBeenCalled();
@@ -127,11 +127,11 @@ describe('TrackRow', () => {
test('shift+click on the row extends the range from the anchor', async () => {
render(TrackRow, { props: { tracks, index: 0 } });
const box = screen.getByRole('checkbox', { name: /select so what/i });
const box = screen.getByRole('checkbox', { name: /select so then/i });
await fireEvent.click(box);
const { container } = render(TrackRow, { props: { tracks, index: 1 } });
const row = container.querySelector('[role="button"][aria-label="Freddie Freeloader"]')!;
const row = container.querySelector('[role="button"][aria-label="Freddie Freewheeler"]')!;
await fireEvent.click(row, { shiftKey: true });
expect(selection.isSelected('t1')).toBe(true);
expect(selection.isSelected('t2')).toBe(true);
@@ -7,9 +7,9 @@ const row: PlaylistTrack = {
track_id: 't-1',
album_id: 'a-1',
artist_id: 'ar-1',
title: 'Roygbiv',
artist_name: 'Boards of Canada',
album_title: 'MHTRTC',
title: 'Prismatic',
artist_name: 'Fields of Ontario',
album_title: 'MHTRTW',
duration_sec: 137,
stream_url: '/api/tracks/t-1/stream',
added_at: '',
@@ -20,11 +20,11 @@ describe('playlistTrackToRef', () => {
test('maps a playable row onto a TrackRef', () => {
expect(playlistTrackToRef(row)).toEqual({
id: 't-1',
title: 'Roygbiv',
title: 'Prismatic',
album_id: 'a-1',
album_title: 'MHTRTC',
album_title: 'MHTRTW',
artist_id: 'ar-1',
artist_name: 'Boards of Canada',
artist_name: 'Fields of Ontario',
duration_sec: 137,
stream_url: '/api/tracks/t-1/stream'
});