From 8d43f4b0323b36a2d58702adc7d7d293f07a70af Mon Sep 17 00:00:00 2001 From: zy410419243 Date: Thu, 7 Mar 2019 12:45:14 +0800 Subject: [PATCH] test: update cases for Modal --- components/modal/__tests__/Modal.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/modal/__tests__/Modal.test.js b/components/modal/__tests__/Modal.test.js index 7cfe27f101..91d916a979 100644 --- a/components/modal/__tests__/Modal.test.js +++ b/components/modal/__tests__/Modal.test.js @@ -43,4 +43,18 @@ describe('Modal', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); + + it('onCancel should be called', () => { + const onCancel = jest.fn(); + const wrapper = mount().instance(); + wrapper.handleCancel(); + expect(onCancel).toBeCalled(); + }); + + it('onOk should be called', () => { + const onOk = jest.fn(); + const wrapper = mount().instance(); + wrapper.handleOk(); + expect(onOk).toBeCalled(); + }); });