Skip to content

Commit 3171d41

Browse files
committed
react pdf frontend test fix
1 parent d6c26e8 commit 3171d41

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/frontend/src/tests/pages/ProjectDetailPage/ProjectViewContainer.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ import { exampleAllWorkPackages } from '../../test-support/test-data/work-packag
1717

1818
vi.mock('../../../utils/axios');
1919
vi.mock('../../../hooks/toasts.hooks');
20+
vi.mock('react-pdf', () => {
21+
return {
22+
__esModule: true,
23+
Document: () => <div>Document Mock</div>,
24+
Page: () => <div>Page Mock</div>,
25+
pdfjs: {
26+
GlobalWorkerOptions: {
27+
workerSrc: ''
28+
}
29+
}
30+
};
31+
});
2032

2133
// Sets up the component under test with the desired values and renders it.
2234
const renderComponent = () => {

0 commit comments

Comments
 (0)