@@ -270,22 +270,16 @@ test("{ cursor: 'move' }", function() {
270
270
271
271
} ) ;
272
272
273
- /*
274
- test("{ cursorAt: false}, default", function() {
275
- expect( 1 );
276
-
277
- ok(false, "missing test - untested code is broken code");
278
- });
279
- */
280
-
281
- test ( "{ cursorAt: left, top }" , function ( ) {
282
- expect ( 16 ) ;
273
+ test ( "cursorAt" , function ( ) {
274
+ expect ( 24 ) ;
283
275
284
276
var deltaX = - 3 ,
285
277
deltaY = - 3 ,
286
278
tests = {
279
+ "false" : { cursorAt : false } ,
287
280
"{ left: -5, top: -5 }" : { x : - 5 , y : - 5 , cursorAt : { left : - 5 , top : - 5 } } ,
288
281
"[ 10, 20 ]" : { x : 10 , y : 20 , cursorAt : [ 10 , 20 ] } ,
282
+ "'10 20'" : { x : 10 , y : 20 , cursorAt : "10 20" } ,
289
283
"{ left: 20, top: 40 }" : { x : 20 , y : 40 , cursorAt : { left : 20 , top : 40 } } ,
290
284
"{ right: 10, bottom: 20 }" : { x : 10 , y : 20 , cursorAt : { right : 10 , bottom : 20 } }
291
285
} ;
@@ -295,9 +289,12 @@ test( "{ cursorAt: left, top }", function() {
295
289
var el = $ ( "#draggable" + ( i + 1 ) ) . draggable ( {
296
290
cursorAt : testData . cursorAt ,
297
291
drag : function ( event , ui ) {
298
- if ( testData . cursorAt . right ) {
292
+ if ( ! testData . cursorAt ) {
293
+ equal ( ui . position . left - ui . originalPosition . left , deltaX , testName + " " + position + " left" ) ;
294
+ equal ( ui . position . top - ui . originalPosition . top , deltaY , testName + " " + position + " top" ) ;
295
+ } else if ( testData . cursorAt . right ) {
299
296
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" ) ;
297
+ equal ( ui . helper . height ( ) - ( event . clientY - ui . offset . top ) , testData . y - TestHelpers . draggable . unreliableOffset , testName + " " + position + " top" ) ;
301
298
} else {
302
299
equal ( event . clientX - ui . offset . left , testData . x + TestHelpers . draggable . unreliableOffset , testName + " " + position + " left" ) ;
303
300
equal ( event . clientY - ui . offset . top , testData . y + TestHelpers . draggable . unreliableOffset , testName + " " + position + " top" ) ;
0 commit comments