diff --git a/pages/login.page.test.tsx b/pages/login.page.test.tsx index b66a9ec1b..7675b9811 100644 --- a/pages/login.page.test.tsx +++ b/pages/login.page.test.tsx @@ -10,6 +10,7 @@ import i18n from 'src/lib/i18n'; import theme from 'src/theme'; import Login, { LoginProps, getServerSideProps } from './login.page'; +process.env.HELPJUICE_KNOWLEDGE_BASE_URL = 'help.mpdx.org'; jest.mock('next-auth/react', () => ({ getSession: jest.fn(), signIn: jest.fn(), @@ -176,7 +177,7 @@ describe('Login - OKTA', () => { name: /find help/i, }); await waitFor(() => { - expect(findHelpLink).toHaveAttribute('href', 'https://help.mpdx.org'); + expect(findHelpLink).toHaveAttribute('href', 'help.mpdx.org'); }); }); }); diff --git a/pages/login.page.tsx b/pages/login.page.tsx index 2bb3274d4..4fa97213c 100644 --- a/pages/login.page.tsx +++ b/pages/login.page.tsx @@ -37,6 +37,9 @@ const Login = ({ } }, []); + const helpUrl = + process.env.HELPJUICE_KNOWLEDGE_BASE_URL || process.env.HELPJUICE_ORIGIN; + return ( <>
@@ -64,16 +67,18 @@ const Login = ({ > {signInButtonText} - } - href="https://help.mpdx.org" - target="_blank" - rel="noopener noreferrer" - style={{ color: '#fff' }} - > - Find help - + {helpUrl && ( + } + href={helpUrl} + target="_blank" + rel="noopener noreferrer" + style={{ color: '#fff' }} + > + Find help + + )} {isOkta && (