diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2013-03-11 21:28:51 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-03-11 22:08:21 -0400 |
commit | 4d67f4f34908a50ef88f95df4103ee001b777e45 (patch) | |
tree | e14cd5bcc22a960ab65db9bd6567f9b8638ce272 /tests/unit/droppable/droppable_methods.js | |
parent | 4f95a0f396965e91982f1b5e67da814bb6640ce1 (diff) | |
download | jquery-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/droppable/droppable_methods.js')
-rw-r--r-- | tests/unit/droppable/droppable_methods.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/unit/droppable/droppable_methods.js b/tests/unit/droppable/droppable_methods.js index 2b452a63d..f7682d262 100644 --- a/tests/unit/droppable/droppable_methods.js +++ b/tests/unit/droppable/droppable_methods.js @@ -63,26 +63,29 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test("disable", function() { - expect(7); +test( "disable", function() { + expect( 10 ); - var el, actual, expected; + var actual, expected, + element = $( "#droppable1" ).droppable({ disabled: false }); - el = $("#droppable1").droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); - el.droppable("disable"); + element.droppable( "disable" ); TestHelpers.droppable.shouldNotDrop(); - equal(el.droppable("option", "disabled"), true, "disabled option getter"); - el.droppable("destroy"); - el.droppable({ disabled: false }); + equal( element.droppable( "option", "disabled" ), true, "disabled option getter" ); + element.droppable( "destroy" ); + element.droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); - el.droppable("option", "disabled", true); - equal(el.droppable("option", "disabled"), true, "disabled option setter"); + element.droppable( "option", "disabled", true ); + ok( !element.droppable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.droppable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.droppable( "widget" ).hasClass( "ui-droppable-disabled" ), "element gets ui-droppable-disabled" ); + equal( element.droppable( "option", "disabled" ), true, "disabled option setter" ); TestHelpers.droppable.shouldNotDrop(); - expected = $("<div></div>").droppable(), - actual = expected.droppable("disable"); - equal(actual, expected, "disable is chainable"); + expected = $( "<div></div>" ).droppable(); + actual = expected.droppable( "disable" ); + equal( actual, expected, "disable is chainable" ); }); })(jQuery); |