Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraPinilla committed Jul 26, 2024
1 parent 113986a commit 9496cdd
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ function FacebookSignIn({ customButtons, socialSignOnIn, className }) {

if (customButtons) {
return (
<div data-testid="custom-facebook-btn">
<Button
id="facebook-btn"
variant="secondary-reverse"
iconLeft={FacebookIcon}
className={`${className}__Facebook`}
onClick={() => window?.onFacebookSignOn()}
>
{socialSignOnIn !== SIGN_UP ? (
<span>{phrases.t("identity-block.social-signOn-facebook-login")}</span>
) : (
<span>{phrases.t("identity-block.social-signOn-facebook-signUp")}</span>
)}
</Button>
</div>
<Button
id="facebook-btn"
variant="secondary-reverse"
iconLeft={FacebookIcon}
className={`${className}__Facebook`}
onClick={() => window?.onFacebookSignOn()}
>
{socialSignOnIn !== SIGN_UP ? (
<span>{phrases.t("identity-block.social-signOn-facebook-login")}</span>
) : (
<span>{phrases.t("identity-block.social-signOn-facebook-signUp")}</span>
)}
</Button>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,31 @@ function GoogleSignIn({ customButtons, socialSignOnIn, className }) {

if (customButtons) {
return (
<div data-testid="custom-google-sign-in-button">
<Button
id="custom-google-signin-btn"
variant="secondary-reverse"
iconLeft={GoogleIcon}
className={`${className}__Google`}
onClick={() =>
window.google.accounts.id.prompt((notification) => {
if (notification.isSkippedMoment()) {
// https://developers.google.com/identity/gsi/web/reference/js-reference
// https://developers.google.com/identity/gsi/web/guides/features#exponential_cooldown
// eslint-disable-next-line
alert(googleNotification);
// Remove cookie works in Safari
document.cookie = `g_state=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT`;
window.google.accounts.id.prompt();
}
})
}
>
{socialSignOnIn !== SIGN_UP ? (
<span>{phrases.t("identity-block.social-signOn-google-login")}</span>
) : (
<span>{phrases.t("identity-block.social-signOn-google-signUp")}</span>
)}
</Button>
</div>
<Button
id="custom-google-signin-btn"
variant="secondary-reverse"
iconLeft={GoogleIcon}
className={`${className}__Google`}
onClick={() =>
window.google.accounts.id.prompt((notification) => {
if (notification.isSkippedMoment()) {
// https://developers.google.com/identity/gsi/web/reference/js-reference
// https://developers.google.com/identity/gsi/web/guides/features#exponential_cooldown
// eslint-disable-next-line
alert(googleNotification);
// Remove cookie works in Safari
document.cookie = `g_state=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT`;
window.google.accounts.id.prompt();
}
})
}
>
{socialSignOnIn !== SIGN_UP ? (
<span>{phrases.t("identity-block.social-signOn-google-login")}</span>
) : (
<span>{phrases.t("identity-block.social-signOn-google-signUp")}</span>
)}
</Button>
);
}
return (
Expand Down
Loading

0 comments on commit 9496cdd

Please sign in to comment.