Fix to tagsbox test timeout in CI (#3665)
Activate the window only when the document does not have focus. Some platforms (macOS) require the window to be brought to the front, while others (Linux) place it at the front from the start, and activation should be skipped.
This commit is contained in:
parent
3a2cd70684
commit
4b3f61d8ca
1 changed files with 12 additions and 9 deletions
|
@ -16,8 +16,10 @@ describe("Item Tags Box", function () {
|
|||
|
||||
|
||||
describe("Tag Editing", function () {
|
||||
it.skip("should update tag when pressing Enter in textbox", async function () {
|
||||
it("should update tag when pressing Enter in textbox", async function () {
|
||||
if (!doc.hasFocus()) {
|
||||
// editable-text behavior relies on focus, so we first need to bring the window to the front.
|
||||
// Not required on all platforms. In some cases (e.g. Linux), the window is at the front from the start.
|
||||
let win = Zotero.getMainWindow();
|
||||
let activatePromise = new Promise(
|
||||
resolve => win.addEventListener('activate', resolve, { once: true })
|
||||
|
@ -25,6 +27,7 @@ describe("Item Tags Box", function () {
|
|||
Zotero.Utilities.Internal.activate();
|
||||
Zotero.Utilities.Internal.activate(win);
|
||||
await activatePromise;
|
||||
}
|
||||
|
||||
var tag = Zotero.Utilities.randomString();
|
||||
var newTag = Zotero.Utilities.randomString();
|
||||
|
|
Loading…
Reference in a new issue