fix(server,web/m7-381): forward-fix CI — Mount call + admin.test mock
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user