Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 053f7c9

Browse files
committed
Fix QuickOpen unit tests after introduction of QuickSearchField - listens
for Enter on keydown, not keyup; expects an "input" event to follow every text change (Enter key processing now waits until text change events have caught up so Enter key never takes effect if change event never comes)
1 parent 6345cf1 commit 053f7c9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/widgets/ModalBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ define(function (require, exports, module) {
229229
};
230230

231231
/**
232-
* If autoClose is set, handles the RETURN/ESC keys in the input field.
232+
* If autoClose is set, close the bar when Escape is pressed
233233
*/
234234
ModalBar.prototype._handleKeydown = function (e) {
235235
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {

test/spec/QuickOpen-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ define(function (require, exports, module) {
8080

8181
testWindow.setTimeout(function () {
8282
getSearchField().val(str);
83+
getSearchField().trigger("input");
8384
}, timeoutLength);
8485
}
8586

@@ -88,7 +89,7 @@ define(function (require, exports, module) {
8889

8990
// Using keyup here because of inside knowledge of how the events are processed
9091
// on the QuickOpen input.
91-
SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keyup", getSearchField()[0]);
92+
SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", getSearchField()[0]);
9293
}
9394

9495
/**

0 commit comments

Comments
 (0)