From 4d5f8d4ae07826aa6e118e2c6b2ef81ae00d57ff Mon Sep 17 00:00:00 2001 From: Keith Wood Date: Wed, 1 Apr 2009 10:11:35 +0000 Subject: Datepicker: fixed #4301 - option dateFormat getter does not return same value as setter --- tests/unit/datepicker/datepicker_options.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/unit/datepicker') 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() { -- cgit v1.2.3