mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
Add test for 3b0a704
This commit is contained in:
parent
aa88c656f1
commit
980b2cc32b
@ -2,6 +2,8 @@ import React from 'react';
|
||||
import { mount, render } from 'enzyme';
|
||||
import moment from 'moment';
|
||||
import DatePicker from '../';
|
||||
import UnwrappedRangePicker from '../RangePicker';
|
||||
import locale from '../locale/en_US';
|
||||
import { setMockDate, resetMockDate } from '../../../tests/utils';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
|
||||
@ -133,4 +135,22 @@ describe('RangePicker', () => {
|
||||
).toBe(true);
|
||||
resetMockDate();
|
||||
});
|
||||
|
||||
it('clear hover value only when picker is open', () => {
|
||||
const wrapper = mount(
|
||||
<UnwrappedRangePicker
|
||||
locale={locale}
|
||||
onChange={() => {}}
|
||||
ranges={{ Today: [moment(), moment()] }}
|
||||
/>
|
||||
);
|
||||
|
||||
wrapper.find('.ant-calendar-range-picker-input').first().simulate('click');
|
||||
wrapper.find('.ant-calendar-range-quick-selector a')
|
||||
.simulate('mouseEnter')
|
||||
.simulate('click')
|
||||
.simulate('mouseLeave');
|
||||
|
||||
expect(wrapper.state().hoverValue).not.toBe(null);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user