diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-12-22 17:39:36 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-12-22 17:39:36 -0500 |
commit | ecb7b6ec1217e06bc2a26a7da694ce0a0fd84221 (patch) | |
tree | 27f2ce26d88be8a4be507c4a825e0f05c126bcde /tests | |
parent | 46925b8808a8fe3cbaf612266cfc0c40ad992888 (diff) | |
download | jquery-ui-ecb7b6ec1217e06bc2a26a7da694ce0a0fd84221.tar.gz jquery-ui-ecb7b6ec1217e06bc2a26a7da694ce0a0fd84221.zip |
Draggable Tests: add back in unreliable offset hack for cursorAt tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/draggable/draggable_options.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index 504aff65d..71a0d2f84 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -281,7 +281,8 @@ test("{ cursorAt: false}, default", function() { test( "{ cursorAt: left, top }", function() { expect( 16 ); - var deltaX = -3, deltaY = -3, + var deltaX = -3, + deltaY = -3, tests = { "{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt : { left: -5, top: -5 } }, "[ 10, 20 ]": { x: 10, y: 20, cursorAt : [ 10, 20 ] }, @@ -295,11 +296,11 @@ test( "{ cursorAt: left, top }", function() { cursorAt: testData.cursorAt, drag: function( event, ui ) { if( testData.cursorAt.right ) { - equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x, testName + " " + position + " left" ); - equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y, testName + position + " top" ); + equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x + TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" ); + equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y + TestHelpers.draggable.unreliableOffset, testName + position + " top" ); } else { - equal( event.clientX - ui.offset.left, testData.x, testName + " " + position + " left" ); - equal( event.clientY - ui.offset.top, testData.y, testName + " " + position + " top" ); + equal( event.clientX - ui.offset.left, testData.x + TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" ); + equal( event.clientY - ui.offset.top, testData.y + TestHelpers.draggable.unreliableOffset, testName + " " + position + " top" ); } } }); |