mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
close more leftover windows in tests (#5460)
- close hyphenationTest window. - properly close zoteroPane window in preferences_syncTest. after() hook inside of the test would not close the window until the very end of the entire test run. Without this, during subsequent tests that open their own zoteroPane window, there are two instances of zoteroPane open at the same time. - close open tabs in readerTest cleanup, since subsequent tests expect library tab to be selected. Followup to https://github.com/zotero/zotero/pull/5444#issuecomment-3141879892
This commit is contained in:
parent
74926fcc2e
commit
873beebc0f
3 changed files with 10 additions and 4 deletions
|
|
@ -1,8 +1,14 @@
|
|||
describe("Hyphenation", function () {
|
||||
let win;
|
||||
|
||||
after(function() {
|
||||
win.close();
|
||||
});
|
||||
|
||||
it("should not cause a segfault", async function () {
|
||||
// Files in test/tests/data/ (resources://) can't be parsed as XUL/XHTML, so the data for this test is in
|
||||
// test/content/ (chrome://), which can
|
||||
window.openDialog('chrome://zotero-unit/content/hyphenationTest.xhtml', 'test', 'chrome');
|
||||
win = window.openDialog('chrome://zotero-unit/content/hyphenationTest.xhtml', 'test', 'chrome');
|
||||
await Zotero.Promise.delay(200);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -122,9 +122,6 @@ describe("Sync Preferences", function () {
|
|||
|
||||
it("should clear sync errors from the toolbar after logging in", async function () {
|
||||
let win = await loadZoteroPane();
|
||||
after(function () {
|
||||
win.close();
|
||||
});
|
||||
|
||||
let syncError = win.document.getElementById('zotero-tb-sync-error');
|
||||
|
||||
|
|
@ -134,6 +131,8 @@ describe("Sync Preferences", function () {
|
|||
getAPIKeyFromCredentialsStub.resolves(apiResponse);
|
||||
await setCredentials("Username", "correctPassword");
|
||||
assert.isTrue(syncError.hidden);
|
||||
|
||||
win.close();
|
||||
});
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ describe("Reader", function () {
|
|||
});
|
||||
|
||||
after(function () {
|
||||
win.Zotero_Tabs.closeAll();
|
||||
win.close();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue