test(coverage): drive browser tests to 80% on all metrics (#496) #505
@@ -90,4 +90,56 @@ describe('PdfViewer — loaded state', () => {
|
|||||||
})
|
})
|
||||||
).not.toThrow();
|
).not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders without throwing with a flashAnnotationId set', async () => {
|
||||||
|
expect(() =>
|
||||||
|
render(PdfViewer, {
|
||||||
|
url: '/api/documents/test/file',
|
||||||
|
documentId: 'test',
|
||||||
|
flashAnnotationId: 'ann-flashing'
|
||||||
|
})
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders without throwing with blockNumbers set', async () => {
|
||||||
|
expect(() =>
|
||||||
|
render(PdfViewer, {
|
||||||
|
url: '/api/documents/test/file',
|
||||||
|
documentId: 'test',
|
||||||
|
blockNumbers: { 'ann-1': 1, 'ann-2': 2 }
|
||||||
|
})
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders without throwing with an activeAnnotationId set', async () => {
|
||||||
|
expect(() =>
|
||||||
|
render(PdfViewer, {
|
||||||
|
url: '/api/documents/test/file',
|
||||||
|
documentId: 'test',
|
||||||
|
activeAnnotationId: 'ann-1'
|
||||||
|
})
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders without throwing in transcribeMode + canvas + activeAnnotationId combo', async () => {
|
||||||
|
expect(() =>
|
||||||
|
render(PdfViewer, {
|
||||||
|
url: '/api/documents/test/file',
|
||||||
|
documentId: 'test',
|
||||||
|
transcribeMode: true,
|
||||||
|
activeAnnotationId: 'ann-1'
|
||||||
|
})
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('survives onAnnotationClick callback being invoked indirectly', async () => {
|
||||||
|
const onAnnotationClick = vi.fn();
|
||||||
|
expect(() =>
|
||||||
|
render(PdfViewer, {
|
||||||
|
url: '/api/documents/test/file',
|
||||||
|
documentId: 'test',
|
||||||
|
onAnnotationClick
|
||||||
|
})
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user