aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable/draggable_methods.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2013-03-11 21:28:51 -0400
committerMike Sherov <mike.sherov@gmail.com>2013-03-11 22:08:21 -0400
commit4d67f4f34908a50ef88f95df4103ee001b777e45 (patch)
treee14cd5bcc22a960ab65db9bd6567f9b8638ce272 /tests/unit/draggable/draggable_methods.js
parent4f95a0f396965e91982f1b5e67da814bb6640ce1 (diff)
downloadjquery-ui-4d67f4f34908a50ef88f95df4103ee001b777e45.tar.gz
jquery-ui-4d67f4f34908a50ef88f95df4103ee001b777e45.zip
Widget: Stop setting ui-state-disabled and aria by default on setting disabled option.
Fixes #5973 - Resizable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #5974 - Draggable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #6039 - Droppable : disabled should not have ui-state-disabled
Diffstat (limited to 'tests/unit/draggable/draggable_methods.js')
-rw-r--r--tests/unit/draggable/draggable_methods.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/draggable/draggable_methods.js b/tests/unit/draggable/draggable_methods.js
index 901c261d6..63a19e26d 100644
--- a/tests/unit/draggable/draggable_methods.js
+++ b/tests/unit/draggable/draggable_methods.js
@@ -74,16 +74,16 @@ test( "enable", function() {
});
test( "disable", function() {
- expect( 7 );
+ expect( 10 );
- element = $("#draggable2").draggable({ disabled: false });
+ element = $( "#draggable2" ).draggable({ disabled: false });
TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );
- element.draggable("disable");
+ element.draggable( "disable" );
TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" );
equal( element.draggable( "option", "disabled" ), true, "disabled option getter" );
- element.draggable("destroy");
+ element.draggable( "destroy" );
element.draggable({ disabled: false });
TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );
@@ -91,8 +91,12 @@ test( "disable", function() {
equal( element.draggable( "option", "disabled" ), true, "disabled option setter" );
TestHelpers.draggable.shouldNotMove( 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" );
+ ok( element.draggable( "widget" ).hasClass( "ui-draggable-disabled" ), "element gets ui-draggable-disabled" );
+
var expected = element.draggable(),
- actual = expected.draggable("disable");
+ actual = expected.draggable( "disable" );
equal( actual, expected, "disable is chainable" );
});