Created
May 4, 2021 18:21
-
-
Save sibelius/9cc90ebbff77c5e6112df5054b1cf603 to your computer and use it in GitHub Desktop.
react-google-login jest mock
This file contains 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
jest.mock('react-google-login', () => { | |
const defaultMockSuccess = { | |
tokenId: 'tokenId', | |
}; | |
const GoogleLogin = ({ onSuccess, buttonText }) => { | |
const handleClick = () => { | |
onSuccess(defaultMockSuccess); | |
}; | |
return <button onClick={handleClick}>{buttonText}</button>; | |
}; | |
return GoogleLogin; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment