From cb961cdf0124ee59558bc3c06513ec7583547af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 22 Jul 2018 01:01:07 +0800 Subject: [PATCH] remove snap in destroyOnClose test --- .../drawer/__tests__/DrawerEvent.test.js | 6 +- .../__snapshots__/DrawerEvent.test.js.snap | 79 ------------------- 2 files changed, 4 insertions(+), 81 deletions(-) diff --git a/components/drawer/__tests__/DrawerEvent.test.js b/components/drawer/__tests__/DrawerEvent.test.js index 618659055f..a3bda0b90d 100644 --- a/components/drawer/__tests__/DrawerEvent.test.js +++ b/components/drawer/__tests__/DrawerEvent.test.js @@ -90,12 +90,14 @@ describe('Drawer', () => { it('destroyOnClose is true onClose', () => { const wrapper = mount(); - expect(wrapper.render()).toMatchSnapshot(); + wrapper.find('button.ant-btn').simulate('click'); + expect(wrapper.find('.ant-drawer-wrapper-body').exists()).toBe(true); + wrapper.setState({ visible: false, }); wrapper.find('.ant-drawer-wrapper-body').simulate('transitionend'); - expect(wrapper.render()).toMatchSnapshot(); + expect(wrapper.find('.ant-drawer-wrapper-body').exists()).toBe(false); }); it('no mask and no closable', () => { diff --git a/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap b/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap index a4f9fda074..875ab4c752 100644 --- a/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap @@ -1,84 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Drawer destroyOnClose is true onClose 1`] = ` -
- -
-
-
-
-
-
- -
- Here is content of Drawer -
-
-
-
-
-
-
-`; - -exports[`Drawer destroyOnClose is true onClose 2`] = ` -
- -
-
-
-
-
-
-
-
-
-`; - exports[`Drawer render correctly 1`] = `