diff --git a/frontend/src/lib/document/viewer/PdfViewer.svelte.test.ts b/frontend/src/lib/document/viewer/PdfViewer.svelte.test.ts index a109303f..3918c6db 100644 --- a/frontend/src/lib/document/viewer/PdfViewer.svelte.test.ts +++ b/frontend/src/lib/document/viewer/PdfViewer.svelte.test.ts @@ -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(); + }); });