mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
✅ fix test cov for Search onChange
This commit is contained in:
parent
6f695b050e
commit
09810a28d9
@ -141,14 +141,15 @@ describe('Input.Search', () => {
|
||||
// https://github.com/ant-design/ant-design/issues/18729
|
||||
it('should trigger onSearch when click clear icon', () => {
|
||||
const onSearch = jest.fn();
|
||||
const wrapper = mount(<Search allowClear defaultValue="value" onSearch={onSearch} />);
|
||||
const onChange = jest.fn();
|
||||
const wrapper = mount(
|
||||
<Search allowClear defaultValue="value" onSearch={onSearch} onChange={onChange} />,
|
||||
);
|
||||
wrapper
|
||||
.find('.ant-input-clear-icon')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(onSearch).toHaveBeenLastCalledWith(
|
||||
'',
|
||||
expect.anything(),
|
||||
);
|
||||
expect(onSearch).toHaveBeenLastCalledWith('', expect.anything());
|
||||
expect(onChange).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user