summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2019-09-18 12:09:28 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2019-09-19 08:20:50 +0000
commit3e21daaf457919087000e430e9ab1ba0ab93902b (patch)
tree6ccc4210bcb8dc57093b30a533380a769bd2a172 /addons
parent948ce04649e46520a7f1d94d0249bbc776d27c2b (diff)
[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 <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/tests/helpers/test_utils_dom.js4
1 files changed, 3 insertions, 1 deletions
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');