Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
react-google-login jest mock
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