Last active
February 22, 2019 19:44
-
-
Save alirezamirian/22710e6d57a59dc58d72da977988fdbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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