aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable/draggable_methods.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-04-06 12:42:49 -0400
committerScott González <scott.gonzalez@gmail.com>2015-04-09 09:26:26 -0400
commitfbc55446fbc397f7f176fd907fd5da5ff3d3abad (patch)
tree201fc1d4cd7db849aad4ebc57e19072f55556021 /tests/unit/draggable/draggable_methods.js
parent9fb04e42a24263a88dc3adf1b9ce6a199309b24c (diff)
downloadjquery-ui-fbc55446fbc397f7f176fd907fd5da5ff3d3abad.tar.gz
jquery-ui-fbc55446fbc397f7f176fd907fd5da5ff3d3abad.zip
Draggable: Convert tests to new infrastructure
Ref #10119 Ref gh-1528
Diffstat (limited to 'tests/unit/draggable/draggable_methods.js')
-rw-r--r--tests/unit/draggable/draggable_methods.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/unit/draggable/draggable_methods.js b/tests/unit/draggable/draggable_methods.js
index 210f48964..44e5feb43 100644
--- a/tests/unit/draggable/draggable_methods.js
+++ b/tests/unit/draggable/draggable_methods.js
@@ -1,7 +1,8 @@
-/*
- * draggable_methods.js
- */
-(function( $ ) {
+define( [
+ "jquery",
+ "./draggable_test_helpers",
+ "ui/draggable"
+], function( $, draggableTestHelpers ) {
var element;
@@ -54,19 +55,19 @@ test( "enable", function() {
expect( 11 );
element.draggable({ disabled: true });
- TestHelpers.draggable.shouldNotDrag( element, ".draggable({ disabled: true })" );
+ draggableTestHelpers.shouldNotDrag( element, ".draggable({ disabled: true })" );
element.draggable("enable");
- TestHelpers.draggable.shouldMove( element, ".draggable('enable')" );
+ draggableTestHelpers.shouldMove( element, ".draggable('enable')" );
equal( element.draggable( "option", "disabled" ), false, "disabled option getter" );
element.draggable("destroy");
element.draggable({ disabled: true });
- TestHelpers.draggable.shouldNotDrag( element, ".draggable({ disabled: true })" );
+ draggableTestHelpers.shouldNotDrag( element, ".draggable({ disabled: true })" );
element.draggable( "option", "disabled", false );
equal(element.draggable( "option", "disabled" ), false, "disabled option setter" );
- TestHelpers.draggable.shouldMove( element, ".draggable('option', 'disabled', false)" );
+ draggableTestHelpers.shouldMove( element, ".draggable('option', 'disabled', false)" );
var expected = element.draggable(),
actual = expected.draggable("enable");
@@ -77,19 +78,19 @@ test( "disable", function( assert ) {
expect( 14 );
element = $( "#draggable2" ).draggable({ disabled: false });
- TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );
+ draggableTestHelpers.shouldMove( element, ".draggable({ disabled: false })" );
element.draggable( "disable" );
- TestHelpers.draggable.shouldNotDrag( element, ".draggable('disable')" );
+ draggableTestHelpers.shouldNotDrag( element, ".draggable('disable')" );
equal( element.draggable( "option", "disabled" ), true, "disabled option getter" );
element.draggable( "destroy" );
element.draggable({ disabled: false });
- TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );
+ draggableTestHelpers.shouldMove( element, ".draggable({ disabled: false })" );
element.draggable( "option", "disabled", true );
equal( element.draggable( "option", "disabled" ), true, "disabled option setter" );
- TestHelpers.draggable.shouldNotDrag( element, ".draggable('option', 'disabled', true)" );
+ draggableTestHelpers.shouldNotDrag( element, ".draggable('option', 'disabled', true)" );
assert.lacksClasses( element.draggable( "widget" ), "ui-state-disabled" );
ok( !element.draggable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
@@ -100,4 +101,4 @@ test( "disable", function( assert ) {
equal( actual, expected, "disable is chainable" );
});
-})( jQuery );
+} );