diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-11-04 09:31:56 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-11-04 09:31:56 -0500 |
commit | 068d597166468470dd8c7888a9f892f0ae4bedb5 (patch) | |
tree | b543d63a14d9d0e462a9bf347af96b7ba00a8891 | |
parent | 3df9ea29e644a3dd6345161513dae5823d9b0460 (diff) | |
download | jquery-ui-068d597166468470dd8c7888a9f892f0ae4bedb5.tar.gz jquery-ui-068d597166468470dd8c7888a9f892f0ae4bedb5.zip |
Dev: fix IE fails in draggable and selectable - Fixed #8770 Dev: Remove globals and Standardize Test Suite
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 4 | ||||
-rw-r--r-- | tests/unit/selectable/selectable_options.js | 2 | ||||
-rw-r--r-- | tests/unit/selectable/selectable_test_helpers.js | 14 |
3 files changed, 8 insertions, 12 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 0e9d04be1..39151d5f7 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -24,8 +24,8 @@ test("element types", function() { offsetBefore = el.offset(); TestHelpers.draggable.drag(el, 50, 50); offsetAfter = el.offset(); - //there are some rounding errors in FF and Chrome, so we can't say equal, we have to settle for close enough - ok(offsetAfter.left - offsetBefore.left - 50 < 1 && offsetAfter.top - offsetBefore.top - 50 < 1, 'dragged[50, 50] ' + "<" + typeName + ">"); + // there are some rounding errors in FF, Chrome, and IE9, so we can't say equal, we have to settle for close enough + ok( offsetAfter.left - offsetBefore.left - 50 <= 1 && offsetAfter.top - offsetBefore.top - 50 <= 1, "dragged[50, 50] " + "<" + typeName + ">" ); el.draggable("destroy"); el.remove(); }); diff --git a/tests/unit/selectable/selectable_options.js b/tests/unit/selectable/selectable_options.js index 2b7fc1648..50e047427 100644 --- a/tests/unit/selectable/selectable_options.js +++ b/tests/unit/selectable/selectable_options.js @@ -26,7 +26,7 @@ test("autoRefresh", function() { TestHelpers.selectable.drag(el, 1000, 1000); equal(actual, 0); sel.show(); - TestHelpers.selectable.drag(el, 1000, 1000); + TestHelpers.selectable.drag( sel[ 0 ], 1000, 1000 ); equal(actual, sel.length); el.selectable("destroy"); sel.show(); diff --git a/tests/unit/selectable/selectable_test_helpers.js b/tests/unit/selectable/selectable_test_helpers.js index c707ab622..6f87efbb3 100644 --- a/tests/unit/selectable/selectable_test_helpers.js +++ b/tests/unit/selectable/selectable_test_helpers.js @@ -1,12 +1,8 @@ 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); + drag: function( el, dx, dy ) { + $( el ).simulate( "drag", { + dx: dx || 0, + dy: dy || 0 + }); } };
\ No newline at end of file |