diff options
author | Amanpreet Singh <apsdehal@gmail.com> | 2016-04-03 22:02:14 +0530 |
---|---|---|
committer | Amanpreet Singh <apsdehal@gmail.com> | 2016-04-14 00:06:12 +0530 |
commit | 8470b6a96552285a8b8e68fb86a8611d75d017d1 (patch) | |
tree | 916d20ed18c1d27b25897e17e09587a12703219c /tests/unit/droppable/options.js | |
parent | 46f607af976abef77bf53685d21fa836359c8438 (diff) | |
download | jquery-ui-8470b6a96552285a8b8e68fb86a8611d75d017d1.tar.gz jquery-ui-8470b6a96552285a8b8e68fb86a8611d75d017d1.zip |
Droppable: Shift to use no globals
Diffstat (limited to 'tests/unit/droppable/options.js')
-rw-r--r-- | tests/unit/droppable/options.js | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/tests/unit/droppable/options.js b/tests/unit/droppable/options.js index 856c2d215..1c164495b 100644 --- a/tests/unit/droppable/options.js +++ b/tests/unit/droppable/options.js @@ -1,12 +1,13 @@ define( [ + "qunit", "jquery", "ui/widgets/droppable" -], function( $ ) { +], function( QUnit, $ ) { -module( "droppable: options" ); +QUnit.module( "droppable: options" ); /* -test( "{ accept '*' }, default ", function() { +Test( "{ accept '*' }, default ", function() { ok(false, 'missing test - untested code is broken code'); }); @@ -22,23 +23,23 @@ test( "activeClass", function() { ok(false, 'missing test - untested code is broken code'); }); */ -test( "{ addClasses: true }, default", function( assert ) { - expect( 1 ); +QUnit.test( "{ addClasses: true }, default", function( assert ) { + assert.expect( 1 ); var el = $( "<div />" ).droppable( { addClasses: true } ); assert.hasClasses( el, "ui-droppable" ); el.droppable( "destroy" ); } ); -test( "{ addClasses: false }", function( assert ) { - expect( 1 ); +QUnit.test( "{ addClasses: false }", function( assert ) { + assert.expect( 1 ); var el = $( "<div />" ).droppable( { addClasses: false } ); assert.lacksClasses( el, "ui-droppable" ); el.droppable( "destroy" ); } ); -test( "scope", function() { - expect( 4 ); +QUnit.test( "scope", function( assert ) { + assert.expect( 4 ); var droppableOffset, draggableOffset, oldDraggableOffset, dx, dy, draggable1 = $( "<div />" ).appendTo( "#qunit-fixture" ).draggable( { revert: "invalid" } ), draggable2 = $( "<div />" ).appendTo( "#qunit-fixture" ).droppable(), @@ -60,8 +61,8 @@ test( "scope", function() { } ); draggableOffset = draggable1.offset(); - equal( draggableOffset.left, droppableOffset.left ); - equal( draggableOffset.top, droppableOffset.top ); + assert.equal( draggableOffset.left, droppableOffset.left ); + assert.equal( draggableOffset.top, droppableOffset.top ); // Test that droppable doesn't accept draggable with old scope. draggableOffset = draggable2.offset(); @@ -75,11 +76,11 @@ test( "scope", function() { } ); draggableOffset = draggable2.offset(); - equal( draggableOffset.left, oldDraggableOffset.left ); - equal( draggableOffset.top, oldDraggableOffset.top ); + assert.equal( draggableOffset.left, oldDraggableOffset.left ); + assert.equal( draggableOffset.top, oldDraggableOffset.top ); } ); /* -test( "greedy", function() { +Test( "greedy", function() { ok(false, 'missing test - untested code is broken code'); }); @@ -92,8 +93,8 @@ test( "tolerance, fit", function() { }); */ -test( "tolerance, intersect", function() { - expect( 2 ); +QUnit.test( "tolerance, intersect", function( assert ) { + assert.expect( 2 ); var draggable, droppable, dataset = [ @@ -135,7 +136,7 @@ test( "tolerance, intersect", function() { } ); droppable.off( "drop" ).on( "drop", function() { - equal( true, data[ 2 ], data[ 3 ] ); + assert.equal( true, data[ 2 ], data[ 3 ] ); } ); $( draggable ).simulate( "drag", { @@ -145,8 +146,8 @@ test( "tolerance, intersect", function() { } ); } ); -test( "tolerance, pointer", function() { - expect( 3 ); +QUnit.test( "tolerance, pointer", function( assert ) { + assert.expect( 3 ); var draggable, droppable, dataset = [ @@ -174,7 +175,7 @@ test( "tolerance, pointer", function() { var data = this; droppable.off( "drop" ).on( "drop", function() { - equal( true, data[ 2 ], data[ 3 ] ); + assert.equal( true, data[ 2 ], data[ 3 ] ); } ); $( draggable ).simulate( "drag", { @@ -188,7 +189,7 @@ test( "tolerance, pointer", function() { droppable.css( { top: 15, left: 15 } ); droppable.off( "drop" ).on( "drop", function() { - ok( true, "drop fires as long as pointer is within droppable" ); + assert.ok( true, "drop fires as long as pointer is within droppable" ); } ); $( draggable ).simulate( "drag", { @@ -198,7 +199,7 @@ test( "tolerance, pointer", function() { } ); /* -test( "tolerance, touch", function() { +Test( "tolerance, touch", function() { ok(false, 'missing test - untested code is broken code'); }); */ |