mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
parent
a421d6fca3
commit
2b4d049921
@ -528,4 +528,22 @@ describe('Upload', () => {
|
||||
const wrapper = mount(<Upload listType="picture-card" fileList={[file]} />);
|
||||
expect(wrapper.find('img').length).toBe(0);
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/25077
|
||||
it('should support events', () => {
|
||||
const onClick = jest.fn();
|
||||
const onMouseEnter = jest.fn();
|
||||
const onMouseLeave = jest.fn();
|
||||
const wrapper = mount(
|
||||
<Upload onClick={onClick} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
|
||||
<button type="button">upload</button>
|
||||
</Upload>,
|
||||
);
|
||||
wrapper.find('.ant-upload').at(1).simulate('click');
|
||||
expect(onClick).toHaveBeenCalled();
|
||||
wrapper.find('.ant-upload').at(1).simulate('mouseEnter');
|
||||
expect(onMouseEnter).toHaveBeenCalled();
|
||||
wrapper.find('.ant-upload').at(1).simulate('mouseLeave');
|
||||
expect(onMouseLeave).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
@ -141,7 +141,7 @@
|
||||
"rc-tree": "~3.3.0",
|
||||
"rc-tree-select": "~4.0.0",
|
||||
"rc-trigger": "~4.3.0",
|
||||
"rc-upload": "~3.1.0",
|
||||
"rc-upload": "~3.2.0",
|
||||
"rc-util": "^5.0.1",
|
||||
"scroll-into-view-if-needed": "^2.2.25",
|
||||
"warning": "^4.0.3"
|
||||
|
Loading…
Reference in New Issue
Block a user