import React from 'react'; import { mount } from 'enzyme'; import { I18nProvider } from '@lingui/react'; import api from '../../src/api'; import { API_CONFIG } from '../../src/endpoints'; import About from '../../src/components/About'; describe('', () => { let aboutWrapper; let closeButton; test('initially renders without crashing', () => { aboutWrapper = mount( ); expect(aboutWrapper.length).toBe(1); aboutWrapper.unmount(); }); test('close button calls onAboutModalClose', () => { const onAboutModalClose = jest.fn(); aboutWrapper = mount( ); closeButton = aboutWrapper.find('AboutModalBoxCloseButton Button'); closeButton.simulate('click'); expect(onAboutModalClose).toBeCalled(); aboutWrapper.unmount(); }); });