aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/datepicker/datepicker_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/datepicker/datepicker_options.js')
-rw-r--r--tests/unit/datepicker/datepicker_options.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index 272af9dac..0a3d5cdac 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -469,6 +469,16 @@ test('setDate', function() {
var dateAndTimeClone = new Date(2008, 3 - 1, 28, 1, 11, 0);
inp.datepicker('setDate', dateAndTimeToSet);
equals(dateAndTimeToSet.getTime(), dateAndTimeClone.getTime(), 'Date object passed should not be changed by setDate');
+ // Test onSelect callback is executed when using setDate
+ inp.datepicker('destroy');
+ var testDate = null;
+ inp.datepicker({
+ onSelect: function(dateText, inst) {
+ testDate = new Date(dateText);
+ }
+ });
+ inp.datepicker('setDate', date2);
+ equals(date2.getTime(), testDate.getTime(), 'onSelect is called after setDate');
});
test('altField', function() {