|
19 | 19 | * |
20 | 20 | */ |
21 | 21 |
|
22 | | -/*global describe, it, expect, beforeAll, afterAll, awaitsFor, awaitsForDone */ |
| 22 | +/*global describe, it, expect, beforeAll, afterAll, awaitsFor, awaitsForDone, awaits */ |
23 | 23 |
|
24 | 24 | define(function (require, exports, module) { |
25 | 25 | // Recommended to avoid reloading the integration test window Phoenix instance for each test. |
@@ -66,12 +66,20 @@ define(function (require, exports, module) { |
66 | 66 |
|
67 | 67 | function tripleControlEvent() { |
68 | 68 | keyboardType(Keys.KEY.CONTROL); |
| 69 | + keyboardType(Keys.KEY.CONTROL, "keyup"); |
69 | 70 | keyboardType(Keys.KEY.CONTROL); |
| 71 | + keyboardType(Keys.KEY.CONTROL, "keyup"); |
70 | 72 | keyboardType(Keys.KEY.CONTROL); |
71 | 73 | } |
72 | 74 |
|
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", { |
75 | 83 | key: key, |
76 | 84 | bubbles: true, // Event bubbles up through the DOM |
77 | 85 | cancelable: true, // Event can be canceled, |
@@ -118,6 +126,17 @@ define(function (require, exports, module) { |
118 | 126 | }, "overlay to be closed"); |
119 | 127 | }); |
120 | 128 |
|
| 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 | + |
121 | 140 | async function _verifyMenuNav() { |
122 | 141 | await _openUiNavMode(); |
123 | 142 | keyboardType(Keys.KEY.ARROW_UP); |
|
0 commit comments