From 6bc1551f7ffd94c542bdaf704957aca74a38e524 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Mon, 31 Oct 2022 18:03:42 +0200 Subject: [PATCH] Increase wait time for pdf-reader iframe initialization in tests This is necessary until a proper initialization promise is added to pdf-reader. --- test/tests/pdfReaderTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/pdfReaderTest.js b/test/tests/pdfReaderTest.js index d87050692c..84c306159f 100644 --- a/test/tests/pdfReaderTest.js +++ b/test/tests/pdfReaderTest.js @@ -70,7 +70,7 @@ describe("PDF Reader", function () { var reader = await Zotero.Reader.open(attachment.itemID); // TODO: Implement a promise that would be resolved when pdf-reader is completely loaded var n = 0; - while ((!reader._iframeWindow || !reader._iframeWindow.wrappedJSObject.PDFViewerApplication.pdfDocument) && n++ < 50) { + while ((!reader._iframeWindow || !reader._iframeWindow.wrappedJSObject.PDFViewerApplication.pdfDocument) && n++ < 150) { await Zotero.Promise.delay(100); } await reader._iframeWindow.wrappedJSObject.viewerInstance._viewer._pdfjsPromise;