import React from 'react' import Notification from 'components/UI/Notification' import renderer from 'react-test-renderer' import { configure, shallow } from 'enzyme' import Adapter from 'enzyme-adapter-react-16' import SystemSuccess from 'components/Icon/SystemSuccess' import SystemWarning from 'components/Icon/SystemWarning' import SystemError from 'components/Icon/SystemError' import Spinner from 'components/UI/Spinner' configure({ adapter: new Adapter() }) describe('component.UI.Notification', () => { it('should render correctly', () => { const tree = renderer.create().toJSON() expect(tree).toMatchSnapshot() }) describe('variant = success', () => { it('should render with the success icon', () => { const wrapper = shallow() expect(wrapper.find(SystemSuccess)).toHaveLength(1) }) }) describe('variant = warning', () => { it('should render with the warning icon', () => { const wrapper = shallow() expect(wrapper.find(SystemWarning)).toHaveLength(1) }) }) describe('variant = error', () => { it('should render with the error icon', () => { const wrapper = shallow() expect(wrapper.find(SystemError)).toHaveLength(1) }) }) describe('processing', () => { it('should render with the spinner', () => { const wrapper = shallow() expect(wrapper.find(Spinner)).toHaveLength(1) }) }) })