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:
@@ -7,9 +7,12 @@ import PdfViewer from './PdfViewer.svelte';
|
|||||||
afterEach(cleanup);
|
afterEach(cleanup);
|
||||||
|
|
||||||
function makeFakePdfjsLib() {
|
function makeFakePdfjsLib() {
|
||||||
function TextLayerMock() {}
|
class TextLayerMock {
|
||||||
TextLayerMock.prototype.render = () => Promise.resolve();
|
render() {
|
||||||
TextLayerMock.prototype.cancel = () => {};
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
cancel() {}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
GlobalWorkerOptions: { workerSrc: '' },
|
GlobalWorkerOptions: { workerSrc: '' },
|
||||||
|
|||||||
Reference in New Issue
Block a user