diff --git a/test/tests/translateTest.js b/test/tests/translateTest.js index 3bad97e6f9..e60f536dee 100644 --- a/test/tests/translateTest.js +++ b/test/tests/translateTest.js @@ -17,10 +17,10 @@ function saveItemsThroughTranslator(translatorType, items) { } let translate = new Zotero.Translate[tyname](); - let browser; if (translatorType == "web") { - browser = Zotero.Browser.createHiddenBrowser(); - translate.setDocument(browser.contentDocument); + let doc = Zotero.HTTP.wrapDocument(new DOMParser().parseFromString('', 'text/html'), + `http://localhost/`); + translate.setDocument(doc); } else if (translatorType == "import") { translate.setString(""); } @@ -35,10 +35,7 @@ function saveItemsThroughTranslator(translatorType, items) { " item.complete();\n"+ " }\n"+ "}")); - return translate.translate().then(function(items) { - if (browser) Zotero.Browser.deleteHiddenBrowser(browser); - return items; - }); + return translate.translate(); } /**