|
1 | 1 | // import React from 'react';
|
2 | 2 | // import { render, wait, waitForDomChange } from '@testing-library/react';
|
3 |
| -// import Pdf from '../src'; |
| 3 | +// import Pdf from '../src/parser/use-pdf'; |
4 | 4 | // import { DocumentInitParameters } from 'pdfjs-dist/types/src/display/api';
|
5 | 5 |
|
6 |
| -// jest.mock('pdfjs-dist', () => ({ |
7 |
| -// version: '1.0', |
8 |
| -// GlobalWorkerOptions: { |
9 |
| -// workerSrc: '', |
10 |
| -// }, |
11 |
| -// getDocument: jest.fn((config: DocumentInitParameters) => ({ |
12 |
| -// promise: config.url?.includes('fail_document') |
13 |
| -// ? Promise.reject() |
14 |
| -// : Promise.resolve({ |
15 |
| -// getPage: jest.fn(() => |
16 |
| -// config.url?.includes('fail_page') |
17 |
| -// ? Promise.reject() |
18 |
| -// : Promise.resolve({ |
19 |
| -// getViewport: jest.fn(() => ({ width: 0, height: 0 })), |
20 |
| -// render: jest.fn(() => ({ |
21 |
| -// promise: config.url?.includes('fail_render') |
22 |
| -// ? Promise.reject() |
23 |
| -// : Promise.resolve(), |
24 |
| -// })), |
25 |
| -// }) |
26 |
| -// ), |
27 |
| -// }), |
28 |
| -// })), |
29 |
| -// })); |
| 6 | +// // jest.mock('pdfjs-dist', () => ({ |
| 7 | +// // version: '1.0', |
| 8 | +// // GlobalWorkerOptions: { |
| 9 | +// // workerSrc: '', |
| 10 | +// // }, |
| 11 | +// // getDocument: jest.fn((config: DocumentInitParameters) => ({ |
| 12 | +// // promise: config.url?.includes('fail_document') |
| 13 | +// // ? Promise.reject() |
| 14 | +// // : Promise.resolve({ |
| 15 | +// // getPage: jest.fn(() => |
| 16 | +// // config.url?.includes('fail_page') |
| 17 | +// // ? Promise.reject() |
| 18 | +// // : Promise.resolve({ |
| 19 | +// // getViewport: jest.fn(() => ({ width: 0, height: 0 })), |
| 20 | +// // render: jest.fn(() => ({ |
| 21 | +// // promise: config.url?.includes('fail_render') |
| 22 | +// // ? Promise.reject() |
| 23 | +// // : Promise.resolve(), |
| 24 | +// // })), |
| 25 | +// // }) |
| 26 | +// // ), |
| 27 | +// // }), |
| 28 | +// // })), |
| 29 | +// // })); |
30 | 30 |
|
31 | 31 | // describe('Pdf', () => {
|
32 | 32 | // // it('renders children', async () => {
|
|
94 | 94 | // onPageRenderSuccess={onPageRenderSuccess}
|
95 | 95 | // onPageRenderFail={onPageRenderFail}
|
96 | 96 | // >
|
97 |
| -// {({ canvas }) => canvas} |
| 97 | +// {({ canvas }: any) => canvas} |
98 | 98 | // </Pdf>
|
99 | 99 | // );
|
100 | 100 |
|
|
151 | 151 | // });
|
152 | 152 | // });
|
153 | 153 | // });
|
| 154 | + |
| 155 | +describe('Mock test', () => { |
| 156 | + it.todo('renders children'); |
| 157 | +}); |
0 commit comments