From d0c1a1f60081b348afd816a63caa899ebd86af4d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 20 Jun 2022 17:46:20 -0400 Subject: [PATCH] fx-compat: Fix sync test involving waitForDialog() `waitForDialog()` now returns a regular window, and `window.document.documentElement.textContent` includes all form elements, so this updates a test to include the checkbox label. --- test/tests/syncLocalTest.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/tests/syncLocalTest.js b/test/tests/syncLocalTest.js index 12c395183a..5c38244e86 100644 --- a/test/tests/syncLocalTest.js +++ b/test/tests/syncLocalTest.js @@ -43,17 +43,17 @@ describe("Zotero.Sync.Data.Local", function() { yield Zotero.Users.setCurrentUsername("A"); var handled = false; - waitForDialog(function (dialog) { - var text = dialog.document.documentElement.textContent; + waitForDialog(function (window) { + var text = window.document.documentElement.textContent; var matches = text.match(/“[^”]*”/g); - assert.equal(matches.length, 4); + assert.equal(matches.length, 5); assert.equal(matches[0], "“A”"); assert.equal(matches[1], "“B”"); assert.equal(matches[2], "“A”"); assert.equal(matches[3], "“A”"); - dialog.document.getElementById('zotero-hardConfirmationDialog-checkbox').checked = true; - dialog.document.getElementById('zotero-hardConfirmationDialog-checkbox') + window.document.getElementById('zotero-hardConfirmationDialog-checkbox').checked = true; + window.document.getElementById('zotero-hardConfirmationDialog-checkbox') .dispatchEvent(new Event('command')); handled = true;