From b0ef76cf5720a2e4065a28fe4b8b10642811d325 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 11 Jun 2016 04:50:04 -0400 Subject: [PATCH] Fix instances of browser windows being left open after tests --- test/tests/duplicatesTest.js | 10 ++++------ test/tests/feedItemTest.js | 9 ++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test/tests/duplicatesTest.js b/test/tests/duplicatesTest.js index 946b96ad23..a52995b811 100644 --- a/test/tests/duplicatesTest.js +++ b/test/tests/duplicatesTest.js @@ -8,19 +8,17 @@ describe("Duplicate Items", function () { thisArg: this, skipBundledFiles: true }); - }); - beforeEach(function* () { + Zotero.Prefs.clear('duplicateLibraries'); win = yield loadZoteroPane(); zp = win.ZoteroPane; cv = zp.collectionsView; - + }); + beforeEach(function* () { return selectLibrary(win); }) after(function () { - if (win) { - win.close(); - } + win.close(); }); describe("Merging", function () { diff --git a/test/tests/feedItemTest.js b/test/tests/feedItemTest.js index 95681553bf..8e2324e8c4 100644 --- a/test/tests/feedItemTest.js +++ b/test/tests/feedItemTest.js @@ -208,10 +208,17 @@ describe("Zotero.FeedItem", function () { }); describe('#translate()', function() { + var win; + before(function* () { // Needs an open window to be able to create a hidden window for translation - yield loadBrowserWindow(); + win = yield loadBrowserWindow(); }); + + after(function () { + win.close() + }); + it('translates and saves items', function* () { var feedItem = yield createDataObject('feedItem', {libraryID}); var url = getTestDataUrl('metadata/journalArticle-single.html');