aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-12-05 10:38:31 -0500
committerScott González <scott.gonzalez@gmail.com>2012-12-05 10:38:31 -0500
commit598cdae199fed9b3aa1700142e8e00a61fc6e61a (patch)
tree1508b6a39893fcf645f35afa8aa865e99e8c8cf2 /tests
parent3c2acc322782cc08e575405f8123029342e33542 (diff)
downloadjquery-ui-598cdae199fed9b3aa1700142e8e00a61fc6e61a.tar.gz
jquery-ui-598cdae199fed9b3aa1700142e8e00a61fc6e61a.zip
Datepicker: Handle changes to the disabled option. Fixes #8883 - Datepicker: Changing disabled option doesn't work.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/datepicker/datepicker_options.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index 8b8888780..4b09face5 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -48,6 +48,23 @@ test('option', function() {
'Get default settings');
});
+test( "disabled", function() {
+ expect(8);
+ var inp = TestHelpers.datepicker.init('#inp');
+ ok(!inp.datepicker('isDisabled'), 'Initially marked as enabled');
+ ok(!inp[0].disabled, 'Field initially enabled');
+ inp.datepicker('option', 'disabled', true);
+ ok(inp.datepicker('isDisabled'), 'Marked as disabled');
+ ok(inp[0].disabled, 'Field now disabled');
+ inp.datepicker('option', 'disabled', false);
+ ok(!inp.datepicker('isDisabled'), 'Marked as enabled');
+ ok(!inp[0].disabled, 'Field now enabled');
+ inp.datepicker('destroy');
+
+ inp = TestHelpers.datepicker.init('#inp', { disabled: true });
+ ok(inp.datepicker('isDisabled'), 'Initially marked as disabled');
+ ok(inp[0].disabled, 'Field initially disabled');
+})
test('change', function() {
expect( 12 );
var inp = TestHelpers.datepicker.init('#inp'),