Skip to content

Commit

Permalink
Add some more delay
Browse files Browse the repository at this point in the history
To avoid flaky tests in CI.
  • Loading branch information
afcapel committed Sep 22, 2022
1 parent 8f7f9fe commit 5605c0a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/test/system/custom_element_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,27 +345,24 @@ testGroup("Custom element API", { template: "editor_empty" }, () => {
element.addEventListener("trix-blur", () => blurEventCount++)

triggerEvent(element, "blur")
await nextFrame()
await delay(10)

assert.equal(blurEventCount, 1)
assert.equal(focusEventCount, 0)

triggerEvent(element, "focus")

await nextFrame()
await delay(10)

assert.equal(blurEventCount, 1)
assert.equal(focusEventCount, 1)

insertImageAttachment()

await delay(20)

await clickElement(element.querySelector("figure"))

const textarea = element.querySelector("textarea")
textarea.focus()

await nextFrame()

assert.equal(document.activeElement, textarea)
Expand Down

0 comments on commit 5605c0a

Please sign in to comment.