Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { shallow } from 'enzyme'
- describe('when the mouse moves', () => {
- const renderMock = jest.fn();
- const wrapper = shallow(<Mouse render={renderMock} />);
- wrapper.find('div').simulate('mousemove', {
- clientX: 50,
- clientY: 20,
- });
- it('should call `render` with the mouse coordinates', () => {
- expect(renderMock).toHaveBeenCalledWith({ x: 50, y: 20 });
- });
- });
Add Comment
Please, Sign In to add comment