fix: T16 verification cleanups
- golangci-lint: errcheck on resp.Body.Close in Lidarr client + revive unused-parameter in delete_test.go - coverage: 2 error-branch tests added to lidarrquarantine.Service (DeleteFile + DeleteViaLidarr track-not-found paths) bring per-package coverage to 81.4% (target >=80%) - search/tracks.test.ts: same TrackMenu name-collision fix T13 applied to TrackRow.test.ts — exact-string button match instead of regex
This commit is contained in:
@@ -35,6 +35,13 @@ vi.mock('@tanstack/svelte-query', async (orig) => {
|
||||
return { ...actual, useQueryClient: () => ({}) };
|
||||
});
|
||||
|
||||
vi.mock('$lib/api/quarantine', () => ({
|
||||
flagTrack: vi.fn(),
|
||||
unflagTrack: vi.fn(),
|
||||
listMyQuarantine: vi.fn().mockResolvedValue([]),
|
||||
createMyQuarantineQuery: vi.fn()
|
||||
}));
|
||||
|
||||
import TracksOverflow from './+page.svelte';
|
||||
import { createSearchTracksInfiniteQuery } from '$lib/api/queries';
|
||||
import { playRadio } from '$lib/player/store.svelte';
|
||||
@@ -62,7 +69,7 @@ describe('search tracks overflow', () => {
|
||||
mockInfiniteQuery({ pages: [page([track], 1)] })
|
||||
);
|
||||
render(TracksOverflow);
|
||||
expect(screen.getByRole('button', { name: /So What/ })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: 'So What' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('clicking a track row triggers playRadio with the track id', async () => {
|
||||
@@ -70,7 +77,7 @@ describe('search tracks overflow', () => {
|
||||
mockInfiniteQuery({ pages: [page([track], 1)] })
|
||||
);
|
||||
render(TracksOverflow);
|
||||
await fireEvent.click(screen.getByRole('button', { name: /So What/ }));
|
||||
await fireEvent.click(screen.getByRole('button', { name: 'So What' }));
|
||||
expect(playRadio).toHaveBeenCalledWith('t1');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user