mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
test(m3): retarget collapsed barrel mocks to deep submodules
The move tool rewrote single-module mocks (e.g. vi.mock('@/utils/orbitBulkGuard'))
into feature-BARREL mocks (vi.mock('@/features/orbit', ...)). A partial barrel
factory shadows every other barrel export to undefined — and src/test/helpers/
storeReset.ts reads useOrbitStore.getState() at module load, so 6 test files
(playerStore.misc/events/queue/playbackActions, ContextMenu, QueuePanel) crashed
at collection (0 tests run, mis-read as flaky teardown). Retarget each collapsed
mock to its deep submodule so the barrel re-exports the stub while siblings
(useOrbitStore, offlineActionPolicy, usePlaylistStore) stay real.
This commit is contained in:
@@ -30,11 +30,11 @@ vi.mock('@/api/subsonic', () => ({
|
||||
}));
|
||||
|
||||
|
||||
vi.mock('@/features/orbit', () => ({
|
||||
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
|
||||
orbitBulkGuard: vi.fn(async () => true),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/offline', () => ({
|
||||
vi.mock('@/features/offline/hooks/useOfflineBrowseContext', () => ({
|
||||
useOfflineBrowseContext: () => ({
|
||||
active: false,
|
||||
serverId: 'srv-1',
|
||||
|
||||
@@ -26,7 +26,7 @@ vi.mock('@/api/subsonic', () => ({
|
||||
}));
|
||||
|
||||
|
||||
vi.mock('@/features/orbit', () => ({
|
||||
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
|
||||
orbitBulkGuard: vi.fn(async () => true),
|
||||
}));
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ vi.mock('@/utils/network/activeServerReachability', () => ({
|
||||
onActiveServerBecameReachable: () => () => {},
|
||||
}));
|
||||
|
||||
vi.mock('@/features/playlist', () => ({
|
||||
vi.mock('@/features/playlist/api/subsonicPlaylists', () => ({
|
||||
getPlaylistForServer: (serverId: string, id: string) => getPlaylistMock(serverId, id),
|
||||
}));
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ vi.mock('@/music-network', () => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('@/features/orbit', () => ({
|
||||
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
|
||||
orbitBulkGuard: vi.fn(async () => true),
|
||||
}));
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ vi.mock('@/music-network', () => ({
|
||||
getMusicNetworkRuntimeOrNull: () => runtimeMock,
|
||||
}));
|
||||
|
||||
vi.mock('@/features/orbit', () => ({
|
||||
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
|
||||
orbitBulkGuard: vi.fn(async () => true),
|
||||
}));
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ vi.mock('@/music-network', () => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('@/features/orbit', () => ({
|
||||
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
|
||||
orbitBulkGuard: vi.fn(async () => true),
|
||||
}));
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ vi.mock('@/api/subsonic', async () => {
|
||||
|
||||
// `enqueue` / `enqueueAt` call `orbitBulkGuard` for multi-track inserts when
|
||||
// the caller hasn't pre-confirmed. Force the guard to short-circuit through.
|
||||
vi.mock('@/features/orbit', () => ({
|
||||
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
|
||||
orbitBulkGuard: vi.fn(async () => true),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user