aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/testUtils.ts
diff options
context:
space:
mode:
authorGuillaume Peoc'h <guillaume.peoch@sonarsource.com>2022-05-30 11:17:09 +0200
committersonartech <sonartech@sonarsource.com>2022-05-31 20:02:50 +0000
commita5b423674c8da134b60f464857fed2ea3df74b01 (patch)
treefc394b2715d1d8358fcd247dc8c113a6787181d2 /server/sonar-web/src/main/js/helpers/testUtils.ts
parent5dc735487ccaa4fd9557a2bc99b1654756c65d8d (diff)
downloadsonarqube-a5b423674c8da134b60f464857fed2ea3df74b01.tar.gz
sonarqube-a5b423674c8da134b60f464857fed2ea3df74b01.zip
SONAR-16337 Handle shortcuts and inputs when keydown
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/testUtils.ts')
-rw-r--r--server/sonar-web/src/main/js/helpers/testUtils.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/helpers/testUtils.ts b/server/sonar-web/src/main/js/helpers/testUtils.ts
index 1b1abba7dbe..72228cf16e0 100644
--- a/server/sonar-web/src/main/js/helpers/testUtils.ts
+++ b/server/sonar-web/src/main/js/helpers/testUtils.ts
@@ -82,7 +82,12 @@ export const KEYCODE_MAP: { [code in KeyboardCodes]?: string } = {
[KeyboardCodes.DownArrow]: 'down'
};
-export function keydown(args: { code?: KeyboardCodes; key?: KeyboardKeys }): void {
+export function keydown(args: {
+ code?: KeyboardCodes;
+ key?: KeyboardKeys;
+ metaKey?: boolean;
+ ctrlKey?: boolean;
+}): void {
const event = new KeyboardEvent('keydown', args as KeyboardEventInit);
document.dispatchEvent(event);
}