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/button/button_options.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/button/button_options.js')
-rw-r--r-- | tests/unit/button/button_options.js | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index e1931a54e..124a8699f 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -3,19 +3,26 @@ */ (function($) { -module("button: options"); +module( "button: options" ); -test("disabled, explicit value", function() { - expect( 4 ); - $("#radio01").button({ disabled: false }); - deepEqual(false, $("#radio01").button("option", "disabled"), - "disabled option set to false"); - deepEqual(false, $("#radio01").prop("disabled"), "element is disabled"); +test( "disabled, explicit value", function() { + expect( 9 ); - $("#radio02").button({ disabled: true }); - deepEqual(true, $("#radio02").button("option", "disabled"), - "disabled option set to true"); - deepEqual(true, $("#radio02").prop("disabled"), "element is not disabled"); + var element = $( "#radio01" ).button({ disabled: false }); + deepEqual( element.button( "option", "disabled" ), false, "disabled option set to false" ); + deepEqual( element.prop( "disabled" ), false, "element is disabled" ); + + ok( !element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); + ok( !element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" ); + + element = $( "#radio02" ).button({ disabled: true }); + + ok( element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); + ok( !element.button( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" ); + + deepEqual( element.button( "option", "disabled" ), true, "disabled option set to true" ); + deepEqual( element.prop( "disabled" ), true, "element is not disabled" ); }); test("disabled, null", function() { |