mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 03:22:59 +08:00
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:
parent
67a505cb1d
commit
b434e0a2ad
@ -183,4 +183,20 @@ describe('DatePicker', () => {
|
|||||||
.length,
|
.length,
|
||||||
).toBe(60);
|
).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…
Reference in New Issue
Block a user