import React from 'react'; import { mount } from 'enzyme'; import Drawer from '..'; class DrawerTester extends React.Component { saveContainer = (container) => { this.container = container; } getContainer = () => { return this.container; } render() { return (
Here is content of Drawer
); } } describe('Drawer', () => { it('render correctly', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('have a title', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('closable is false', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); it('destroyOnClose is true', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); });