fix: Use latest rc-picker version with defaultPickerValue/showTime fix (#32107)

* update rc-picker dependency to 2.5.17

* add test: DatePicker.RangePicker with defaultPickerValue and showTime
This commit is contained in:
Thomas Zipner 2021-09-10 04:54:11 +01:00 committed by GitHub
parent 67a505cb1d
commit b434e0a2ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,4 +183,20 @@ describe('DatePicker', () => {
.length,
).toBe(60);
});
it('DatePicker.RangePicker with defaultPickerValue and showTime', () => {
const startDate = moment('1982-02-12');
const endDate = moment('1982-02-22');
const wrapper = mount(
<DatePicker.RangePicker defaultPickerValue={[startDate, endDate]} showTime open />,
);
const month = wrapper.find('.ant-picker-header-view .ant-picker-month-btn').text();
const year = wrapper.find('.ant-picker-header-view .ant-picker-year-btn').text();
expect(month).toBe(startDate.format('MMM'));
expect(year).toBe(startDate.format('YYYY'));
expect(wrapper.find('.ant-picker-time-panel').length).toBe(1);
});
});