aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authormarcneuwirth <marc.neuwirth@gmail.com>2011-06-28 10:59:08 -0500
committerCorey Frang <gnarf@gnarf.net>2011-06-28 11:00:06 -0500
commitb8e14e79e5bc630bf459137896c08fc37936f52f (patch)
treed39e2bc9c195a0fe627ddbdca967e80857f69545 /tests/unit
parentbb9f9fac816dd379e810e8b70823bb7980250ffb (diff)
downloadjquery-ui-b8e14e79e5bc630bf459137896c08fc37936f52f.tar.gz
jquery-ui-b8e14e79e5bc630bf459137896c08fc37936f52f.zip
Datepicker: Added onSelect.apply() call to _setDate method if onSelect is defined. Fixed #6264 - Datepicker: onSelect does not fire when setDate is called
(cherry picked from commit effdd5d19c534f8445ebafe4212278c4366b0041)
Diffstat (limited to 'tests/unit')
-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 b14c87b8b..a6d4b8fbc 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -474,6 +474,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() {