feat: don't show support button (#746)

Do not show the button "Need help logging in?"
if there is no support page for sign-in issues.
This commit is contained in:
Dmytro
2023-02-14 12:54:57 +02:00
committed by GitHub
parent 8dbf20b3d2
commit fd4404ec28
2 changed files with 20 additions and 10 deletions

View File

@@ -141,16 +141,18 @@ const ForgotPasswordPage = (props) => {
onClick={handleSubmit}
onMouseDown={(e) => e.preventDefault()}
/>
<Hyperlink
id="forgot-password"
name="forgot-password"
className="ml-4 font-weight-500 text-body"
destination={getConfig().LOGIN_ISSUE_SUPPORT_LINK}
target="_blank"
showLaunchIcon={false}
>
{intl.formatMessage(messages['need.help.sign.in.text'])}
</Hyperlink>
{(getConfig().LOGIN_ISSUE_SUPPORT_LINK) && (
<Hyperlink
id="forgot-password"
name="forgot-password"
className="ml-4 font-weight-500 text-body"
destination={getConfig().LOGIN_ISSUE_SUPPORT_LINK}
target="_blank"
showLaunchIcon={false}
>
{intl.formatMessage(messages['need.help.sign.in.text'])}
</Hyperlink>
)}
<p className="mt-5.5 small text-gray-700">
{intl.formatMessage(messages['additional.help.text'], { platformName })}
<span>

View File

@@ -66,7 +66,15 @@ describe('ForgotPasswordPage', () => {
};
});
it('not should display need other help signing in button', () => {
const wrapper = mount(reduxWrapper(<IntlForgotPasswordPage {...props} />));
expect(wrapper.find('#forgot-password').exists()).toBeFalsy();
});
it('should display need other help signing in button', () => {
mergeConfig({
LOGIN_ISSUE_SUPPORT_LINK: '/support',
});
const wrapper = mount(reduxWrapper(<IntlForgotPasswordPage {...props} />));
expect(wrapper.find('#forgot-password').first().text()).toEqual('Need help signing in?');
});