diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-08-18 14:51:30 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-08-18 14:51:30 -0400 |
commit | 2838c11ea8fa1bd8dfffe27a6e28dee6d3e0d423 (patch) | |
tree | 93c101413e2e3d5c0c62157b278d97b30ca84d7f /tests/unit | |
parent | 9060bf3d09a547563e94815f9e0a1c4908ebd904 (diff) | |
download | jquery-ui-2838c11ea8fa1bd8dfffe27a6e28dee6d3e0d423.tar.gz jquery-ui-2838c11ea8fa1bd8dfffe27a6e28dee6d3e0d423.zip |
Button: Read disabled attribute from original element if disabled option is null. Fixes #5252 -Button: read disabled option from input elements.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/button/button_defaults.js | 2 | ||||
-rw-r--r-- | tests/unit/button/button_options.js | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/unit/button/button_defaults.js b/tests/unit/button/button_defaults.js index e1657854a..b81fa7cbb 100644 --- a/tests/unit/button/button_defaults.js +++ b/tests/unit/button/button_defaults.js @@ -3,7 +3,7 @@ */ var button_defaults = { - disabled: false, + disabled: null, text: true, label: null, icons: { diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index 6ee8ab541..5b25ecd63 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -5,6 +5,30 @@ module("button: options"); +test("disabled, explicity value", function() { + $("#radio01").button({ disabled: false }); + same(false, $("#radio01").button("option", "disabled"), + "disabled option set to false"); + same(false, $("#radio01").attr("disabled"), "element is disabled"); + + $("#radio02").button({ disabled: true }); + same(true, $("#radio02").button("option", "disabled"), + "disabled option set to true"); + same(true, $("#radio02").attr("disabled"), "element is not disabled"); +}); + +test("disabled, null", function() { + $("#radio01").button({ disabled: null }); + same(false, $("#radio01").button("option", "disabled"), + "disabled option set to false"); + same(false, $("#radio01").attr("disabled"), "element is disabled"); + + $("#radio02").attr("disabled", "disabled").button({ disabled: null }); + same(true, $("#radio02").button("option", "disabled"), + "disabled option set to true"); + same(true, $("#radio02").attr("disabled"), "element is not disabled"); +}); + test("text false without icon", function() { $("#button").button({ text: false |