diff options
Diffstat (limited to 'tests/unit/selectable/selectable_test_helpers.js')
-rw-r--r-- | tests/unit/selectable/selectable_test_helpers.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/selectable/selectable_test_helpers.js b/tests/unit/selectable/selectable_test_helpers.js new file mode 100644 index 000000000..c707ab622 --- /dev/null +++ b/tests/unit/selectable/selectable_test_helpers.js @@ -0,0 +1,12 @@ +TestHelpers.selectable = { + drag: function(el, dx, dy) { + var off = el.offset(), + pos = { clientX: off.left, clientY: off.top }; + el.simulate("mousedown", pos); + $(document).simulate("mousemove", pos); + pos.clientX += dx; + pos.clientY += dy; + $(document).simulate("mousemove", pos); + $(document).simulate("mouseup", pos); + } +};
\ No newline at end of file |