From 2e081ce8d24873c0126e1fe845c9054df2a3e935 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 27 Apr 2023 00:52:01 -0400 Subject: [PATCH] Fix RemoteTranslate test after b222bbcccb And remove duplicate test --- test/tests/RemoteTranslateTest.js | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/test/tests/RemoteTranslateTest.js b/test/tests/RemoteTranslateTest.js index 9a93c28dc6..abf2383095 100644 --- a/test/tests/RemoteTranslateTest.js +++ b/test/tests/RemoteTranslateTest.js @@ -109,36 +109,12 @@ describe("RemoteTranslate", function () { title: 'Title' })); // Item should still be returned - assert.equal(items[0].title, 'Title'); + assert.equal(items[0].getField('title'), 'Title'); HiddenBrowser.destroy(browser); translate.dispose(); }); - it("should save items and call itemDone when libraryID is not false", async function () { - let translate = new RemoteTranslate(); - let browser = await HiddenBrowser.create(getTestDataUrl('test.html')); - await translate.setBrowser(browser); - translate.setTranslator(dummyTranslator); - - let itemDone = sinon.spy(); - translate.setHandler('itemDone', itemDone); - - let items = await translate.translate({ libraryID: null }); // User library - sinon.assert.calledWith(itemDone, translate, - sinon.match({ - libraryID: Zotero.Libraries.userLibraryID - }), - sinon.match({ - title: 'Title' - })); - // Item should still be returned - assert.equal(items[0].title, 'Title'); - - HiddenBrowser.destroy(browser); - translate.dispose(); - }); - it("should call itemDone before done", async function () { let translate = new RemoteTranslate(); let browser = await HiddenBrowser.create(getTestDataUrl('test.html'));