diff options
author | Keith Wood <kbwood.au@gmail.com> | 2009-04-01 10:11:35 +0000 |
---|---|---|
committer | Keith Wood <kbwood.au@gmail.com> | 2009-04-01 10:11:35 +0000 |
commit | 4d5f8d4ae07826aa6e118e2c6b2ef81ae00d57ff (patch) | |
tree | 58008f64a515c5ce8ef20ffdaaaecb8bcf099430 /tests/unit/datepicker | |
parent | 73abb29d2c8d546657a14729692a4d43731d2dda (diff) | |
download | jquery-ui-4d5f8d4ae07826aa6e118e2c6b2ef81ae00d57ff.tar.gz jquery-ui-4d5f8d4ae07826aa6e118e2c6b2ef81ae00d57ff.zip |
Datepicker: fixed #4301 - option dateFormat getter does not return same value as setter
Diffstat (limited to 'tests/unit/datepicker')
-rw-r--r-- | tests/unit/datepicker/datepicker_options.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js index b03040913..412519a4b 100644 --- a/tests/unit/datepicker/datepicker_options.js +++ b/tests/unit/datepicker/datepicker_options.js @@ -18,6 +18,7 @@ test('setDefaults', function() { test('option', function() { var inp = init('#inp'); var inst = $.data(inp[0], PROP_NAME); + // Set option equals(inst.settings.showOn, null, 'Initial setting showOn'); equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn'); equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn'); @@ -33,6 +34,16 @@ test('option', function() { equals(inst.settings.showOn, null, 'Clear setting showOn'); equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn'); equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + // Get option + inp = init('#inp'); + equals(inp.datepicker('option', 'showOn'), 'focus', 'Initial setting showOn'); + inp.datepicker('option', 'showOn', 'button'); + equals(inp.datepicker('option', 'showOn'), 'button', 'Change instance showOn'); + inp.datepicker('option', 'showOn', undefined); + equals(inp.datepicker('option', 'showOn'), 'focus', 'Reset instance showOn'); + same(inp.datepicker('option', 'all'), {duration: ''}, 'Get instance settings'); + same(inp.datepicker('option', 'defaults'), $.datepicker._defaults, + 'Get default settings'); }); test('change', function() { |