Browse Source

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
pull/32121/head
Thomas Zipner 3 years ago
committed by GitHub
parent
commit
b434e0a2ad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      components/date-picker/__tests__/DatePicker.test.js

16
components/date-picker/__tests__/DatePicker.test.js

@ -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);
});
});

Loading…
Cancel
Save