From 3e21daaf457919087000e430e9ab1ba0ab93902b Mon Sep 17 00:00:00 2001 From: Mathieu Duckerts-Antoine Date: Wed, 18 Sep 2019 12:09:28 +0000 Subject: [PATCH] [IMP] web: ctrlKey option in dragAndDrop The gantt view allows the dragged pill to be copied when the key ctrl (or command) is pressed. In order to be able to test that feature, we had to modify testUtils.dragAndDrop. This is done in the present commit. closes odoo/odoo#37074 Signed-off-by: VincentSchippefilt --- addons/web/static/tests/helpers/test_utils_dom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/static/tests/helpers/test_utils_dom.js b/addons/web/static/tests/helpers/test_utils_dom.js index 87013bd4696..a4315002cab 100644 --- a/addons/web/static/tests/helpers/test_utils_dom.js +++ b/addons/web/static/tests/helpers/test_utils_dom.js @@ -40,6 +40,7 @@ var concurrency = require('web.concurrency'); * @param {jQuery|HTMLElement} [options.mousedownTarget=undefined] target of the mousedown event * @param {jQuery|HTMLElement} [options.mousemoveTarget=undefined] target of the mousemove event * @param {jQuery|HTMLElement} [options.mouseupTarget=undefined] target of the mouseup event + * @param {jQuery|HTMLElement} [options.ctrlKey=undefined] if the ctrl key should be considered pressed at the time of mouseup * @returns {Promise} */ function dragAndDrop($el, $to, options) { @@ -102,7 +103,8 @@ function dragAndDrop($el, $to, options) { triggerEvent(options.mouseupTarget || el || $el, 'mouseup', { which: 1, pageX: toOffset.left, - pageY: toOffset.top + pageY: toOffset.top, + ctrlKey: options.ctrlKey, }); if (options.withTrailingClick) { triggerEvent(options.mouseupTarget || el || $el, 'click');