diff options
author | Scott González <scott.gonzalez@gmail.com> | 2013-03-14 19:08:21 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2013-03-14 19:08:21 -0400 |
commit | 44d07173db32b498e5f83f60db290ff1463daee3 (patch) | |
tree | 59537f38aae5d3aed4a1a491d0ebfb3635ba8768 /tests/unit/sortable | |
parent | db27541b3ccc8af8c558915d99bcf544d4afacc7 (diff) | |
download | jquery-ui-44d07173db32b498e5f83f60db290ff1463daee3.tar.gz jquery-ui-44d07173db32b498e5f83f60db290ff1463daee3.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
This reverts commit 23771d38ba9d2663f6db0243c8e992dc7ff6844a.
Diffstat (limited to 'tests/unit/sortable')
-rw-r--r-- | tests/unit/sortable/sortable_methods.js | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/tests/unit/sortable/sortable_methods.js b/tests/unit/sortable/sortable_methods.js index 07a7bc77d..f3fe240e7 100644 --- a/tests/unit/sortable/sortable_methods.js +++ b/tests/unit/sortable/sortable_methods.js @@ -64,29 +64,30 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test("disable", function() { - expect(7); +test( "disable", function() { + expect( 9 ); - var el, actual, expected; + var chainable, + element = $( "#sortable" ).sortable({ disabled: false }); - el = $("#sortable").sortable({ disabled: false }); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })"); + TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" ); - el.sortable("disable"); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, "disabled.sortable getter"); + chainable = element.sortable( "disable" ); + TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" ); - el.sortable("destroy"); + element.sortable( "destroy" ); - el.sortable({ disabled: false }); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })"); - el.sortable("option", "disabled", true); - equal(el.sortable("option", "disabled"), true, "disabled option setter"); - ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction"); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable('option', 'disabled', true)"); + element.sortable({ disabled: false }); + TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" ); + element.sortable( "option", "disabled", true); + equal( element.sortable( "option", "disabled" ), true, "disabled option setter" ); - expected = $("<div></div>").sortable(), - actual = expected.sortable("disable"); - equal(actual, expected, "disable is chainable"); + ok( !element.sortable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.sortable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.sortable( "widget" ).hasClass( "ui-sortable-disabled" ), "element gets ui-sortable-disabled" ); + + TestHelpers.sortable.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" ); + equal( chainable, element, "disable is chainable" ); }); })(jQuery); |