Skip to content

Instantly share code, notes, and snippets.

@alirezamirian
Last active February 22, 2019 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alirezamirian/22710e6d57a59dc58d72da977988fdbc to your computer and use it in GitHub Desktop.
Save alirezamirian/22710e6d57a59dc58d72da977988fdbc to your computer and use it in GitHub Desktop.
it('should handle uncontrolled value and change callback', () => {
const onToggleSpy = jest.fn();
const { clickHeader } = mountUsage(<Zippy header={'header'} onToggle={onToggleSpy}/>);
clickHeader();
expect(onToggleSpy).toBeCalledWith(true);
clickHeader();
expect(onToggleSpy).toBeCalledWith(false);
expect(onToggleSpy).toHaveBeenCalledTimes(2);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment