From 8ea740c8001739cb19ad23788734b276fe644fdb Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 29 Nov 2021 22:33:48 +0100 Subject: [PATCH] Slightly extend the "creates pdf doc from PDF file with bad XRef table" unit-test (PR 14304 follow-up) Given that we're able to "render" this document, let's extend the unit-test to actually check that we're able to obtain the operatorList; although given the overall issues in the document it'll be empty. --- test/unit/api_spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index 33226b46a..90df5b5d3 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -457,6 +457,14 @@ describe("api", function () { const pdfDocument = await loadingTask.promise; expect(pdfDocument.numPages).toEqual(1); + const page = await pdfDocument.getPage(1); + expect(page instanceof PDFPageProxy).toEqual(true); + + const opList = await page.getOperatorList(); + expect(opList.fnArray.length).toEqual(0); + expect(opList.argsArray.length).toEqual(0); + expect(opList.lastChunk).toEqual(true); + await loadingTask.destroy(); });