mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
test: update cases for Modal
This commit is contained in:
parent
f38323aeca
commit
8d43f4b032
@ -43,4 +43,18 @@ describe('Modal', () => {
|
||||
const wrapper = mount(<ModalTester footer={null} />);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('onCancel should be called', () => {
|
||||
const onCancel = jest.fn();
|
||||
const wrapper = mount(<Modal onCancel={onCancel} />).instance();
|
||||
wrapper.handleCancel();
|
||||
expect(onCancel).toBeCalled();
|
||||
});
|
||||
|
||||
it('onOk should be called', () => {
|
||||
const onOk = jest.fn();
|
||||
const wrapper = mount(<Modal onOk={onOk} />).instance();
|
||||
wrapper.handleOk();
|
||||
expect(onOk).toBeCalled();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user