diff options
author | Felix Nagel <info@felixnagel.com> | 2013-03-19 19:59:31 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-03-19 19:59:31 +0100 |
commit | 1ce8d87f8bee3b1ec8698e0e2b8ead726d0d4ca2 (patch) | |
tree | 77edf8d66ab74aa11b86c286ba2a528b4d3c36de /tests/unit/button/button_options.js | |
parent | 5a9a80f86cc7844e7357af834c61cc14431110d1 (diff) | |
parent | 1c1f7c6184ba6f6a13e93960ea77c293f9d4308e (diff) | |
download | jquery-ui-1ce8d87f8bee3b1ec8698e0e2b8ead726d0d4ca2.tar.gz jquery-ui-1ce8d87f8bee3b1ec8698e0e2b8ead726d0d4ca2.zip |
Merge branch 'master' into selectmenu
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() { |