Unit testing React click outside component
import { mount } from ‘enzyme’ import React from ‘react’ import ReactDOM from ‘react-dom’ it(‘Should not call action on click inside the component’, () => { const map = {} document.addEventListener = jest.fn((event, cb) => { map[event] = cb }) const props = { actions: { something: jest.fn(), } } const wrapper = mount(<Component {… … Read more