diff options
author | Felix Nagel <info@felixnagel.com> | 2013-11-13 19:45:56 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-11-13 19:45:56 +0100 |
commit | ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f (patch) | |
tree | dedf39afe3330bae4eec603297432d972e5bcfc1 /tests/unit/draggable/draggable_test_helpers.js | |
parent | a6c5f58d8243b39c6cd57b76ffb0776adfcc8b1c (diff) | |
parent | 14782c04e2201c53e3ecb80b086f1a4c27aa991d (diff) | |
download | jquery-ui-ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f.tar.gz jquery-ui-ab2219b6ac3dbab58885a0bd2aaac01c4bcc1c2f.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'tests/unit/draggable/draggable_test_helpers.js')
-rw-r--r-- | tests/unit/draggable/draggable_test_helpers.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/unit/draggable/draggable_test_helpers.js b/tests/unit/draggable/draggable_test_helpers.js index 2edf7452f..0b533a4e1 100644 --- a/tests/unit/draggable/draggable_test_helpers.js +++ b/tests/unit/draggable/draggable_test_helpers.js @@ -20,8 +20,8 @@ TestHelpers.draggable = { var offsetBefore = el.offset(), offsetExpected = { left: offsetBefore.left + expectedDX, top: offsetBefore.top + expectedDY }; - $( el ).one( "dragstop", function() { - deepEqual( el.offset(), offsetExpected, "offset dragged[" + dx + ", " + dy + "] " + msg ); + $( el ).one( "dragstop", function( event, ui ) { + deepEqual( ui.helper.offset(), offsetExpected, "offset dragged[" + dx + ", " + dy + "] " + msg ); } ); }, testDrag: function( el, handle, dx, dy, expectedDX, expectedDY, msg ) { @@ -30,10 +30,7 @@ TestHelpers.draggable = { $( handle ).simulate( "drag", { dx: dx, - dy: dy, - // moves is 1 here because simulate currently fire events synchronously - // so we can't faithfully test things that rely on a scroll event (which is async) - moves: 1 + dy: dy }); }, shouldMovePositionButNotOffset: function( el, msg, handle ) { @@ -43,10 +40,7 @@ TestHelpers.draggable = { $( handle ).simulate( "drag", { dx: 100, - dy: 100, - // moves is 1 here because simulate currently fire events synchronously - // so we can't faithfully test things that rely on a scroll event (which is async) - moves: 1 + dy: 100 }); }, shouldMove: function( el, msg, handle ) { @@ -68,9 +62,13 @@ TestHelpers.draggable = { }); $( el ).unbind( "dragstop" ); }, + setScrollable: function ( what, isScrollable ) { + var overflow = isScrollable ? "scroll" : "hidden"; + $( what ).css({ overflow: overflow, overflowX: overflow, overflowY: overflow }); + }, testScroll: function( el, position ) { var oldPosition = $( "#main" ).css( "position" ); - $( "#main" ).css( "position", position); + $( "#main" ).css({ position: position, top: "0px", left: "0px" }); TestHelpers.draggable.shouldMove( el, position + " parent" ); $( "#main" ).css( "position", oldPosition ); }, |