ant-design/components/date-picker/__tests__/utils.js
Wei Zhu 98387ad819 Control Calendar value, fix #8885 (#9141)
If not control Calendar value, the internal value of Calendar will keep a
different date than parent component.
2018-01-26 23:14:40 +08:00

9 lines
277 B
JavaScript

/* eslint-disable import/prefer-default-export */
export function selectDate(wrapper, date, index) {
let calendar = wrapper;
if (index) {
calendar = wrapper.find('.ant-calendar-range-part')[index];
}
calendar.find({ title: date.format('LL') }).simulate('click');
}