Add test mocks and update delete API assertion

Add missing mocks used by updated code paths: mock PreferencesContext in profile page tests and add useReplaceWithTorrent/replaceWithTorrent mock for InteractiveTorrentSearchModal tests. Update Audiobookshelf API test to expect DELETE to include ?hard=1 and Authorization header. Extend the prisma test helper in audiobook-matcher tests with a reportedIssue.findMany mock and ensure it resolves to an empty array for the test.
This commit is contained in:
kikootwo
2026-02-11 17:02:21 -05:00
parent b1561a8311
commit eca24e46a8
4 changed files with 32 additions and 3 deletions
+9
View File
@@ -17,6 +17,15 @@ vi.mock('@/lib/hooks/useRequests', () => ({
useRequests: useRequestsMock,
}));
vi.mock('@/contexts/PreferencesContext', () => ({
usePreferences: () => ({
cardSize: 5,
setCardSize: vi.fn(),
squareCovers: true,
setSquareCovers: vi.fn(),
}),
}));
vi.mock('@/components/layout/Header', () => ({
Header: () => <div data-testid="header" />,
}));