diff --git a/components/drawer/__tests__/Drawer.test.js b/components/drawer/__tests__/Drawer.test.js index f06bc2a6ebbc74de666c1d7ddc3abc5861b1e9e8..94f06693a0d8a5c78073edc104742c723073a6a5 100644 --- a/components/drawer/__tests__/Drawer.test.js +++ b/components/drawer/__tests__/Drawer.test.js @@ -29,28 +29,21 @@ class DrawerTester extends React.Component { describe('Drawer', () => { it('render correctly', () => { const wrapper = mount(); - const content = wrapper.find('.ant-drawer-body').getDOMNode().innerHTML; - expect(content).toBe('Here is content of Drawer'); expect(wrapper.render()).toMatchSnapshot(); }); it('have a title', () => { const wrapper = mount(); - const title = wrapper.find('.ant-drawer-title').getDOMNode().innerHTML; - expect(title).toBe('Test Title'); - const closable = wrapper.find('.ant-drawer-close').exists(); - expect(closable).toBe(true); + expect(wrapper.render()).toMatchSnapshot(); }); it('closable is false', () => { const wrapper = mount(); - const closable = wrapper.find('.ant-drawer-close').exists(); - expect(closable).toBe(false); + expect(wrapper.render()).toMatchSnapshot(); }); it('destroyOnClose is true', () => { const wrapper = mount(); - const body = wrapper.find('.ant-drawer-body').exists(); - expect(body).toBe(false); + expect(wrapper.render()).toMatchSnapshot(); }); }); diff --git a/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap b/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap index f2c3aaca902acdce2eafc7759b6e4a497e41827c..badd71d7841bd2354c27318764bf16ed4a55a065 100644 --- a/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/Drawer.test.js.snap @@ -1,5 +1,96 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Drawer closable is false 1`] = ` +
+
+
+
+
+
+
+
+
+ Here is content of Drawer +
+
+
+
+
+
+
+
+`; + +exports[`Drawer destroyOnClose is true 1`] = ` +
+
+
+`; + +exports[`Drawer have a title 1`] = ` +
+
+
+
+
+
+
+
+
+
+ Test Title +
+
+ +
+ Here is content of Drawer +
+
+
+
+
+
+
+
+`; + exports[`Drawer render correctly 1`] = `