test(coverage): drive browser tests to 80% on all metrics (#496) #505

Merged
marcel merged 189 commits from feat/issue-496-browser-coverage-tests into main 2026-05-11 21:50:39 +02:00
Showing only changes of commit c34295542d - Show all commits

View File

@@ -90,4 +90,56 @@ describe('PdfViewer — loaded state', () => {
})
).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();
});
});