0
測試自定義事件我想測試changeDate
事件我bootstrap datepicker的:如何通過傳遞操縱事件對象
elem.on('changeDate', function(event) {
var newVal = event.date;
...
});
茉莉:
it('sets a new startDate', function() {
elem.trigger('changeDate', {date: new Date(2014, 1, 2)});
expect(elem.datepicker('getDate')).toEqual(new Date(2014, 1, 2));
});
當登錄event
,全日期選擇器返回object
,但date
仍爲undefined
。我應該如何通過我的自定義測試date
?