aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/testUtils.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-04-03 17:56:23 +0200
committerStas Vilchik <stas-vilchik@users.noreply.github.com>2017-04-13 12:21:37 +0200
commit139261bbc13192621ef795d6d45298e1d8e1b7f3 (patch)
tree7aa153b4b3fec7e8fbf3b3b4f5ed0a1a5cc69113 /server/sonar-web/src/main/js/helpers/testUtils.js
parentd665528c8751ead9ca93e3d18dd8600fac92834b (diff)
downloadsonarqube-139261bbc13192621ef795d6d45298e1d8e1b7f3.tar.gz
sonarqube-139261bbc13192621ef795d6d45298e1d8e1b7f3.zip
SONAR-9064 Rework facets sidebar on the issues page
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/testUtils.js')
-rw-r--r--server/sonar-web/src/main/js/helpers/testUtils.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/helpers/testUtils.js b/server/sonar-web/src/main/js/helpers/testUtils.js
index 602eb3c5786..96b718cc64b 100644
--- a/server/sonar-web/src/main/js/helpers/testUtils.js
+++ b/server/sonar-web/src/main/js/helpers/testUtils.js
@@ -24,7 +24,7 @@ export const mockEvent = {
stopPropagation() {}
};
-export const click = element => element.simulate('click', mockEvent);
+export const click = (element, event = {}) => element.simulate('click', { ...mockEvent, ...event });
export const submit = element =>
element.simulate('submit', {
@@ -37,4 +37,7 @@ export const change = (element, value) =>
currentTarget: { value }
});
-export const keydown = (element, keyCode) => element.simulate('keyDown', { ...mockEvent, keyCode });
+export const keydown = keyCode => {
+ const event = new KeyboardEvent('keydown', { keyCode });
+ document.dispatchEvent(event);
+};