Skip to content
Permalink
Browse files

Draggable Tests: Add position asserts to drag tests

They're currently disabled however due to bugs both
in the tests and in the actual widget.
  • Loading branch information
mikesherov committed Oct 20, 2013
1 parent c9b0e28 commit b8795e15d6692426e76e2503e27d01257694c628
@@ -43,12 +43,12 @@ test( "element types", function() {
});

test( "No options, relative", function() {
expect( 1 );
expect( 2 );
TestHelpers.draggable.shouldMove( $( "#draggable1" ).draggable(), "no options, relative" );
});

test( "No options, absolute", function() {
expect( 1 );
expect( 2 );
TestHelpers.draggable.shouldMove( $( "#draggable2" ).draggable(), "no options, absolute" );
});

@@ -51,18 +51,18 @@ test( "destroy", function() {
});

test( "enable", function() {
expect( 7 );
expect( 9 );

element.draggable({ disabled: true });
TestHelpers.draggable.shouldNotMove( element, ".draggable({ disabled: true })" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable({ disabled: true })" );

element.draggable("enable");
TestHelpers.draggable.shouldMove( element, ".draggable('enable')" );
equal( element.draggable( "option", "disabled" ), false, "disabled option getter" );

element.draggable("destroy");
element.draggable({ disabled: true });
TestHelpers.draggable.shouldNotMove( element, ".draggable({ disabled: true })" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable({ disabled: true })" );

element.draggable( "option", "disabled", false );
equal(element.draggable( "option", "disabled" ), false, "disabled option setter" );
@@ -74,13 +74,13 @@ test( "enable", function() {
});

test( "disable", function() {
expect( 10 );
expect( 12 );

element = $( "#draggable2" ).draggable({ disabled: false });
TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );

element.draggable( "disable" );
TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable('disable')" );
equal( element.draggable( "option", "disabled" ), true, "disabled option getter" );

element.draggable( "destroy" );
@@ -89,7 +89,7 @@ test( "disable", function() {

element.draggable( "option", "disabled", true );
equal( element.draggable( "option", "disabled" ), true, "disabled option setter" );
TestHelpers.draggable.shouldNotMove( element, ".draggable('option', 'disabled', true)" );
TestHelpers.draggable.shouldNotDrag( element, ".draggable('option', 'disabled', true)" );

ok( !element.draggable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
ok( !element.draggable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );

0 comments on commit b8795e1

Please sign in to comment.
You can’t perform that action at this time.