diff --git a/webui/src/routes/import/-route.test.tsx b/webui/src/routes/import/-route.test.tsx index 22341c6b..5825e38c 100644 --- a/webui/src/routes/import/-route.test.tsx +++ b/webui/src/routes/import/-route.test.tsx @@ -2,8 +2,8 @@ import { createMemoryHistory } from '@tanstack/react-router'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ShellBridge, ShellPageId } from '@/platform/shell/bridge'; import { HttpResponse, http, server } from '@/test/msw'; +import { createShellBridge } from '@/test/shell-bridge'; import { createAppQueryClient } from '@/app/query-client'; import { AppRouterProvider, createAppRouter } from '@/app/router'; @@ -11,24 +11,6 @@ import { AppRouterProvider, createAppRouter } from '@/app/router'; import type { ImportStagingFile } from './-import.types'; import { resetImportWorkflowStore } from './-import.store'; -function createShellBridge(overrides: Partial = {}): ShellBridge { - return { - getCurrentProfileContext: vi.fn(() => ({ profileId: 2, isAdmin: true })), - isPageAllowed: vi.fn(() => true), - getProfileHomePage: vi.fn<() => ShellPageId>(() => 'discover'), - resolveLegacyPath: vi.fn<(pathname: string) => ShellPageId | null>(() => 'search'), - setActivePageChrome: vi.fn(), - activateLegacyPath: vi.fn(), - showReactHost: vi.fn(), - navigateToArtistDetail: vi.fn(), - playLibraryTrack: vi.fn(), - startStream: vi.fn(), - showLoadingOverlay: vi.fn(), - hideLoadingOverlay: vi.fn(), - ...overrides, - }; -} - function renderImportRoute(initialEntries = ['/import']) { const queryClient = createAppQueryClient(); const history = createMemoryHistory({ initialEntries });