diff options
author | Phil Hughes <me@iamphill.com> | 2017-02-13 12:15:20 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-02-17 11:29:16 +0000 |
commit | b31f9102f3a038798d9e2c65421891b68221110e (patch) | |
tree | 5f1cb0f107593f1ef9f59538f1ba4357b978723d /app/assets/javascripts/test_utils | |
parent | db0253cf443cb685859b4518040ee307ff8a446a (diff) | |
download | gitlab-ce-b31f9102f3a038798d9e2c65421891b68221110e.tar.gz |
Added ordering feature specs
Diffstat (limited to 'app/assets/javascripts/test_utils')
-rw-r--r-- | app/assets/javascripts/test_utils/simulate_drag.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/test_utils/simulate_drag.js b/app/assets/javascripts/test_utils/simulate_drag.js index 7dba5840c8a..b49f8310c2a 100644 --- a/app/assets/javascripts/test_utils/simulate_drag.js +++ b/app/assets/javascripts/test_utils/simulate_drag.js @@ -55,6 +55,13 @@ ); } + function isLast(target) { + var el = typeof target.el === 'string' ? document.getElementById(target.el.substr(1)) : target.el; + var children = el.children; + + return children.length - 1 === target.index; + } + function getRect(el) { var rect = el.getBoundingClientRect(); var width = rect.right - rect.left; @@ -88,6 +95,10 @@ options.ontap && options.ontap(); window.SIMULATE_DRAG_ACTIVE = 1; + if (isLast(options.to)) { + toRect.cy += 100; + } + var dragInterval = setInterval(function loop() { var progress = (new Date().getTime() - startTime) / duration; var x = (fromRect.cx + (toRect.cx - fromRect.cx) * progress) - scrollable.scrollLeft; |