refactor(test): convert TextLayerMock to class syntax in PdfViewer spec

Prototype-style assignment was a vi.mock hoisting artifact from the old
version of the file. Rest of the codebase uses class syntax — aligning.

Addresses Felix Brandt round-4 suggestion on PR #536.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-12 09:36:47 +02:00
committed by marcel
parent 3ae7c9da0c
commit a693f07eca

View File

@@ -7,9 +7,12 @@ import PdfViewer from './PdfViewer.svelte';
afterEach(cleanup);
function makeFakePdfjsLib() {
function TextLayerMock() {}
TextLayerMock.prototype.render = () => Promise.resolve();
TextLayerMock.prototype.cancel = () => {};
class TextLayerMock {
render() {
return Promise.resolve();
}
cancel() {}
}
return {
GlobalWorkerOptions: { workerSrc: '' },