From fe5d9b4b6a3e14e54b6eaed95ee62d3875a892a3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 2 Oct 2022 11:57:15 +0200 Subject: [PATCH] Remove duplicated `destroy`-calls in the "custom ownerDocument" unit-tests Given that `PDFDocumentProxy.destroy` is nothing but an alias for `PDFDocumentLoadingTask.destroy` calling both methods is obviously not useful. --- test/unit/custom_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/custom_spec.js b/test/unit/custom_spec.js index a0773c369..ae33736ec 100644 --- a/test/unit/custom_spec.js +++ b/test/unit/custom_spec.js @@ -172,7 +172,7 @@ describe("custom ownerDocument", function () { expect(style).toBeFalsy(); expect(ownerDocument.fonts.size).toBeGreaterThanOrEqual(1); expect(Array.from(ownerDocument.fonts).find(checkFont)).toBeTruthy(); - await doc.destroy(); + await loadingTask.destroy(); CanvasFactory.destroy(canvasAndCtx); expect(ownerDocument.fonts.size).toBe(0); @@ -204,7 +204,7 @@ describe("custom ownerDocument", function () { const style = elements.find(element => element.tagName === "style"); expect(style.sheet.cssRules.length).toBeGreaterThanOrEqual(1); expect(style.sheet.cssRules.find(checkFontFaceRule)).toBeTruthy(); - await doc.destroy(); + await loadingTask.destroy(); CanvasFactory.destroy(canvasAndCtx); expect(style.remove.called).toBe(true);