Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix flaky fast edit keyboard shortcut QUnit test (#24425)

Alan Guo Xiang Tan7c1a4e32a67a
diff --git a/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js b/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js
index 6acee1543df..2706de4534d 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/fast-edit-test.js
@@ -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");