1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #18159 from Snuffleupagus/loadingParams-test

Improve the `loadingParams` functionality in the API
This commit is contained in:
Jonas Jenwald 2024-05-24 23:21:24 +02:00 committed by GitHub
commit 17e09e5478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 10 deletions

View file

@ -1069,6 +1069,23 @@ describe("api", function () {
await loadingTask.destroy();
});
it("gets loadingParams", async function () {
const loadingTask = getDocument(
buildGetDocumentParams(basicApiFileName, {
disableAutoFetch: true,
enableXfa: true,
})
);
const pdfDoc = await loadingTask.promise;
expect(pdfDoc.loadingParams).toEqual({
disableAutoFetch: true,
enableXfa: true,
});
await loadingTask.destroy();
});
it("gets page", async function () {
const data = await pdfDocument.getPage(1);
expect(data instanceof PDFPageProxy).toEqual(true);