From 53f57ffdb52474db9a011a0bc38ee7943a02d177 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Wed, 4 Feb 2009 04:53:09 +0000 Subject: selectable unit tests: split tests into individual files --- tests/unit/selectable/selectable_core.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/unit/selectable/selectable_core.js') diff --git a/tests/unit/selectable/selectable_core.js b/tests/unit/selectable/selectable_core.js index e4ccb9efd..d7f716e5d 100644 --- a/tests/unit/selectable/selectable_core.js +++ b/tests/unit/selectable/selectable_core.js @@ -1,6 +1,23 @@ /* * selectable_core.js */ + +var el; + +var drag = function(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); +} + +var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); } + +var margin = function(el, side) { return parseInt(el.css('margin-' + side)); } + (function($) { module("selectable: core"); -- cgit v1.2.3