Guest User

Untitled

a guest
May 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import { shallow } from 'enzyme'
  2.  
  3. describe('when the mouse moves', () => {
  4. const renderMock = jest.fn();
  5. const wrapper = shallow(<Mouse render={renderMock} />);
  6. wrapper.find('div').simulate('mousemove', {
  7. clientX: 50,
  8. clientY: 20,
  9. });
  10.  
  11. it('should call `render` with the mouse coordinates', () => {
  12. expect(renderMock).toHaveBeenCalledWith({ x: 50, y: 20 });
  13. });
  14. });
Add Comment
Please, Sign In to add comment