diff options
author | Richard Worth <rdworth@gmail.com> | 2009-09-19 09:35:53 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2009-09-19 09:35:53 +0000 |
commit | af178c00f160a38dbbaf2fba630ecf9c0ca5ec0b (patch) | |
tree | 362a9b91711ab67f48e001fafdac0bbd337e9bfd /tests/unit | |
parent | 6f1b0d80be4633fdfc132dda0d9f73babc6ab13b (diff) | |
download | jquery-ui-af178c00f160a38dbbaf2fba630ecf9c0ca5ec0b.tar.gz jquery-ui-af178c00f160a38dbbaf2fba630ecf9c0ca5ec0b.zip |
dialog: fixed enable and disable methods
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/dialog/dialog_methods.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index e6ffb14d6..7826979fc 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -68,14 +68,22 @@ test("enable", function() { var expected = $('<div></div>').dialog(), actual = expected.dialog('enable'); equals(actual, expected, 'enable is chainable'); - ok(false, 'missing test - untested code is broken code'); + + el = $('<div></div>').dialog({ disabled: true }); + el.dialog('enable'); + equals(el.dialog('option', 'disabled'), false, 'enable method sets disabled option to false'); + ok(!el.parents('.ui-dialog').hasClass('ui-dialog-disabled'), 'enable method removes ui-dialog-disabled class from ui-dialog element'); }); test("disable", function() { var expected = $('<div></div>').dialog(), actual = expected.dialog('disable'); equals(actual, expected, 'disable is chainable'); - ok(false, 'missing test - untested code is broken code'); + + el = $('<div></div>').dialog({ disabled: false }); + el.dialog('disable'); + equals(el.dialog('option', 'disabled'), true, 'disable method sets disabled option to true'); + ok(el.parents('.ui-dialog').hasClass('ui-dialog-disabled'), 'disable method adds ui-dialog-disabled class to ui-dialog element'); }); test("close", function() { |