Remove explicit delay in tag update test
This commit is contained in:
parent
b9deeb1b15
commit
a0ab7783ee
1 changed files with 7 additions and 4 deletions
|
@ -17,10 +17,14 @@ describe("Item Tags Box", function () {
|
||||||
|
|
||||||
describe("Tag Editing", function () {
|
describe("Tag Editing", function () {
|
||||||
it("should update tag when pressing Enter in textbox", async function () {
|
it("should update tag when pressing Enter in textbox", async function () {
|
||||||
// Bring the window to the front. Without this, fields will never get focus.
|
// editable-text behavior relies on focus, so we first need to bring the window to the front.
|
||||||
|
let win = Zotero.getMainWindow();
|
||||||
|
let activatePromise = new Promise(
|
||||||
|
resolve => win.addEventListener('activate', resolve, { once: true })
|
||||||
|
);
|
||||||
Zotero.Utilities.Internal.activate();
|
Zotero.Utilities.Internal.activate();
|
||||||
Zotero.Utilities.Internal.activate(Zotero.getMainWindow());
|
Zotero.Utilities.Internal.activate(win);
|
||||||
await Zotero.Promise.delay(100);
|
await activatePromise;
|
||||||
|
|
||||||
var tag = Zotero.Utilities.randomString();
|
var tag = Zotero.Utilities.randomString();
|
||||||
var newTag = Zotero.Utilities.randomString();
|
var newTag = Zotero.Utilities.randomString();
|
||||||
|
@ -34,7 +38,6 @@ describe("Item Tags Box", function () {
|
||||||
|
|
||||||
var firstRow = rows[0];
|
var firstRow = rows[0];
|
||||||
firstRow.focus();
|
firstRow.focus();
|
||||||
await Zotero.Promise.delay(100);
|
|
||||||
firstRow.ref.value = newTag;
|
firstRow.ref.value = newTag;
|
||||||
firstRow.ref.dispatchEvent(new Event('input'));
|
firstRow.ref.dispatchEvent(new Event('input'));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue