Skip to content

Commit ecb7b6e

Browse files
committed
Draggable Tests: add back in unreliable offset hack for cursorAt tests
1 parent 46925b8 commit ecb7b6e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/unit/draggable/draggable_options.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ test("{ cursorAt: false}, default", function() {
281281
test( "{ cursorAt: left, top }", function() {
282282
expect( 16 );
283283

284-
var deltaX = -3, deltaY = -3,
284+
var deltaX = -3,
285+
deltaY = -3,
285286
tests = {
286287
"{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt : { left: -5, top: -5 } },
287288
"[ 10, 20 ]": { x: 10, y: 20, cursorAt : [ 10, 20 ] },
@@ -295,11 +296,11 @@ test( "{ cursorAt: left, top }", function() {
295296
cursorAt: testData.cursorAt,
296297
drag: function( event, ui ) {
297298
if( testData.cursorAt.right ) {
298-
equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x, testName + " " + position + " left" );
299-
equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y, testName + position + " top" );
299+
equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x + TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" );
300+
equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y + TestHelpers.draggable.unreliableOffset, testName + position + " top" );
300301
} else {
301-
equal( event.clientX - ui.offset.left, testData.x, testName + " " + position + " left" );
302-
equal( event.clientY - ui.offset.top, testData.y, testName + " " + position + " top" );
302+
equal( event.clientX - ui.offset.left, testData.x + TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" );
303+
equal( event.clientY - ui.offset.top, testData.y + TestHelpers.draggable.unreliableOffset, testName + " " + position + " top" );
303304
}
304305
}
305306
});

0 commit comments

Comments
 (0)