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:
Psychotoxical
2026-06-30 01:50:37 +02:00
parent 862941c145
commit fecda65f11
7 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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',
+1 -1
View File
@@ -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),
}));
+1 -1
View File
@@ -44,7 +44,7 @@ vi.mock('@/music-network', () => {
};
});
vi.mock('@/features/orbit', () => ({
vi.mock('@/features/orbit/utils/orbitBulkGuard', () => ({
orbitBulkGuard: vi.fn(async () => true),
}));
+1 -1
View File
@@ -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),
}));
+1 -1
View File
@@ -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),
}));