import React from 'react'; import { mountWithContexts } from '../enzymeHelpers'; import About from '../../src/components/About'; describe('', () => { let aboutWrapper; let closeButton; const onClose = jest.fn(); test('initially renders without crashing', () => { aboutWrapper = mountWithContexts( ); expect(aboutWrapper.length).toBe(1); aboutWrapper.unmount(); }); test('close button calls onClose handler', () => { aboutWrapper = mountWithContexts( ); closeButton = aboutWrapper.find('AboutModalBoxCloseButton Button'); closeButton.simulate('click'); expect(onClose).toBeCalled(); aboutWrapper.unmount(); }); });