mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
DEV: Fix flaky fast edit keyboard shortcut QUnit test (#24425)
Why this change? The test has been flaky on CI with the following assertion failing: ``` not ok 302 Firefox 115.0 - [899 ms] - Browser Id 5 - Acceptance: Fast Edit: Works with keyboard shortcut --- actual: > Element #fast-edit-input does not exist expected: > Element #fast-edit-input exists ``` The hypothesis here is that we are triggering the `E` keypress event before the `.quote-button` menu has appeared. When that happens, we will end up opening the composer instead of triggering the fast edit editor.
This commit is contained in:
parent
e0ef88abca
commit
7c1a4e32a6
@ -45,6 +45,9 @@ acceptance("Fast Edit", function (needs) {
|
||||
const textNode = query("#post_1 .cooked p").childNodes[0];
|
||||
|
||||
await selectText(textNode, 9);
|
||||
|
||||
assert.dom(".quote-button").exists();
|
||||
|
||||
await triggerKeyEvent(document, "keypress", "E");
|
||||
|
||||
assert.dom("#fast-edit-input").exists();
|
||||
@ -60,7 +63,11 @@ acceptance("Fast Edit", function (needs) {
|
||||
|
||||
// Closing
|
||||
await selectText(textNode, 9);
|
||||
|
||||
assert.dom(".quote-button").exists();
|
||||
|
||||
await triggerKeyEvent(document, "keypress", "E");
|
||||
|
||||
assert.dom("#fast-edit-input").exists();
|
||||
|
||||
await triggerKeyEvent("#fast-edit-input", "keydown", "Escape");
|
||||
|
Loading…
x
Reference in New Issue
Block a user