mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
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:
@@ -17,6 +17,15 @@ const searchEbooksMock = vi.hoisted(() => vi.fn());
|
||||
const selectEbookMock = vi.hoisted(() => vi.fn());
|
||||
const searchEbooksByAsinMock = vi.hoisted(() => vi.fn());
|
||||
const selectEbookByAsinMock = vi.hoisted(() => vi.fn());
|
||||
const replaceWithTorrentMock = vi.hoisted(() => vi.fn());
|
||||
|
||||
vi.mock('@/lib/hooks/useReportedIssues', () => ({
|
||||
useReplaceWithTorrent: () => ({
|
||||
replaceWithTorrent: replaceWithTorrentMock,
|
||||
isLoading: false,
|
||||
error: null,
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/lib/hooks/useRequests', () => ({
|
||||
useInteractiveSearch: () => ({
|
||||
|
||||
Reference in New Issue
Block a user