Skip to content

Commit 7b2bbc3

Browse files
committed
fix: accdental triple ctrlx3 press overlay mode integ tests
1 parent 0162c43 commit 7b2bbc3

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

test/spec/Keyboard-nav-integ-test.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*/
2121

22-
/*global describe, it, expect, beforeAll, afterAll, awaitsFor, awaitsForDone */
22+
/*global describe, it, expect, beforeAll, afterAll, awaitsFor, awaitsForDone, awaits */
2323

2424
define(function (require, exports, module) {
2525
// Recommended to avoid reloading the integration test window Phoenix instance for each test.
@@ -66,12 +66,20 @@ define(function (require, exports, module) {
6666

6767
function tripleControlEvent() {
6868
keyboardType(Keys.KEY.CONTROL);
69+
keyboardType(Keys.KEY.CONTROL, "keyup");
6970
keyboardType(Keys.KEY.CONTROL);
71+
keyboardType(Keys.KEY.CONTROL, "keyup");
7072
keyboardType(Keys.KEY.CONTROL);
7173
}
7274

73-
function keyboardType(key) {
74-
const ctrlEvent = new KeyboardEvent("keydown", {
75+
function tripleControlContinuousEvent() {
76+
keyboardType(Keys.KEY.CONTROL);
77+
keyboardType(Keys.KEY.CONTROL);
78+
keyboardType(Keys.KEY.CONTROL);
79+
}
80+
81+
function keyboardType(key, type) {
82+
const ctrlEvent = new KeyboardEvent(type || "keydown", {
7583
key: key,
7684
bubbles: true, // Event bubbles up through the DOM
7785
cancelable: true, // Event can be canceled,
@@ -118,6 +126,17 @@ define(function (require, exports, module) {
118126
}, "overlay to be closed");
119127
});
120128

129+
it("Should not show overlay on triple control continuous press", async function () {
130+
MainViewManager.setLayoutScheme(1, 1);
131+
await openAnyFile();
132+
await awaitsFor(()=>{
133+
return !testWindow.$('#ctrl-nav-overlay').is(":visible");
134+
}, "overlay to be not visible");
135+
tripleControlContinuousEvent();
136+
await awaits(20); // give some time so that we are sure that the overlay didn't come up.
137+
expect(testWindow.$('#ctrl-nav-overlay').is(":visible")).toBeFalse();
138+
});
139+
121140
async function _verifyMenuNav() {
122141
await _openUiNavMode();
123142
keyboardType(Keys.KEY.ARROW_UP);

0 commit comments

Comments
 (0)