fix(server,web/m7-381): forward-fix CI — Mount call + admin.test mock

This commit is contained in:
2026-05-04 20:19:42 -04:00
parent 05bc2628a3
commit 0db22971c7
2 changed files with 22 additions and 11 deletions
+1 -1
View File
@@ -443,7 +443,7 @@ func TestRoutesRegisteredInMount(t *testing.T) {
r := chi.NewRouter()
w := playevents.NewWriter(h.pool, slog.New(slog.NewTextHandler(io.Discard, nil)),
30*time.Minute, 0.5, 30000)
Mount(r, h.pool, h.logger, w, config.RecommendationConfig{RadioSize: 50, RadioSizeMax: 200, RecentlyPlayedHours: 1}, h.lidarrCfg, h.lidarrRequests, h.lidarrQuarantine, h.tracks, h.playlists, h.coverart, h.coverArtBackfillCap, h.dataDir)
Mount(r, h.pool, h.logger, w, config.RecommendationConfig{RadioSize: 50, RadioSizeMax: 200, RecentlyPlayedHours: 1}, h.lidarrCfg, h.lidarrRequests, h.lidarrQuarantine, h.tracks, h.playlists, h.coverart, h.coverArtBackfillCap, h.scanner, h.scanCfg, h.dataDir)
paths := []string{
"/api/artists",
+21 -10
View File
@@ -16,16 +16,27 @@ vi.mock('$app/state', () => ({
page: { url: new URL('http://localhost/admin') }
}));
vi.mock('$lib/api/admin', () => ({
createAdminRequestsQuery: vi.fn(),
createLidarrConfigQuery: vi.fn(),
createAdminQuarantineQuery: vi.fn(),
approveRequest: vi.fn().mockResolvedValue({}),
rejectRequest: vi.fn().mockResolvedValue({}),
resolveQuarantine: vi.fn().mockResolvedValue({}),
deleteQuarantineFile: vi.fn().mockResolvedValue({}),
deleteQuarantineViaLidarr: vi.fn().mockResolvedValue({})
}));
vi.mock('$lib/api/admin', async () => {
const { readable } = await import('svelte/store');
return {
createAdminRequestsQuery: vi.fn(),
createLidarrConfigQuery: vi.fn(),
createAdminQuarantineQuery: vi.fn(),
createScanStatusQuery: () =>
readable({
data: { id: '', started_at: '', finished_at: null, in_flight: false },
isPending: false,
isError: false
}),
approveRequest: vi.fn().mockResolvedValue({}),
rejectRequest: vi.fn().mockResolvedValue({}),
resolveQuarantine: vi.fn().mockResolvedValue({}),
deleteQuarantineFile: vi.fn().mockResolvedValue({}),
deleteQuarantineViaLidarr: vi.fn().mockResolvedValue({}),
triggerScan: vi.fn().mockResolvedValue({}),
refetchMissingCovers: vi.fn().mockResolvedValue({ queued: 0 })
};
});
vi.mock('@tanstack/svelte-query', async (orig) => {
const actual = (await orig()) as Record<string, unknown>;