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()
|
r := chi.NewRouter()
|
||||||
w := playevents.NewWriter(h.pool, slog.New(slog.NewTextHandler(io.Discard, nil)),
|
w := playevents.NewWriter(h.pool, slog.New(slog.NewTextHandler(io.Discard, nil)),
|
||||||
30*time.Minute, 0.5, 30000)
|
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{
|
paths := []string{
|
||||||
"/api/artists",
|
"/api/artists",
|
||||||
|
|||||||
@@ -16,16 +16,27 @@ vi.mock('$app/state', () => ({
|
|||||||
page: { url: new URL('http://localhost/admin') }
|
page: { url: new URL('http://localhost/admin') }
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('$lib/api/admin', () => ({
|
vi.mock('$lib/api/admin', async () => {
|
||||||
createAdminRequestsQuery: vi.fn(),
|
const { readable } = await import('svelte/store');
|
||||||
createLidarrConfigQuery: vi.fn(),
|
return {
|
||||||
createAdminQuarantineQuery: vi.fn(),
|
createAdminRequestsQuery: vi.fn(),
|
||||||
approveRequest: vi.fn().mockResolvedValue({}),
|
createLidarrConfigQuery: vi.fn(),
|
||||||
rejectRequest: vi.fn().mockResolvedValue({}),
|
createAdminQuarantineQuery: vi.fn(),
|
||||||
resolveQuarantine: vi.fn().mockResolvedValue({}),
|
createScanStatusQuery: () =>
|
||||||
deleteQuarantineFile: vi.fn().mockResolvedValue({}),
|
readable({
|
||||||
deleteQuarantineViaLidarr: vi.fn().mockResolvedValue({})
|
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) => {
|
vi.mock('@tanstack/svelte-query', async (orig) => {
|
||||||
const actual = (await orig()) as Record<string, unknown>;
|
const actual = (await orig()) as Record<string, unknown>;
|
||||||
|
|||||||
Reference in New Issue
Block a user