Skip to content

Instantly share code, notes, and snippets.

@andyrichardson
Created November 4, 2019 18:43
Show Gist options
  • Save andyrichardson/47c7b8151732918e1569e91905f84fa7 to your computer and use it in GitHub Desktop.
Save andyrichardson/47c7b8151732918e1569e91905f84fa7 to your computer and use it in GitHub Desktop.
describe('on user click', () => {
const props = {
  friends,
  onUserChange: jest.fn(),
  };
it('calls on user change', () => {
  const wrapper = shallow(<FriendsList {…props} />);
  wrapper.find('FriendItem[value="Paul"]').simulate('click'); 
  expect(onUserChange).toBeCalledWith('Paul');
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment