diff --git a/src/__tests__/LoginPage/SignIn.test.js b/src/__tests__/LoginPage/SignIn.test.js index e94ae47d..015706d2 100644 --- a/src/__tests__/LoginPage/SignIn.test.js +++ b/src/__tests__/LoginPage/SignIn.test.js @@ -7,7 +7,7 @@ import userEvent from '@testing-library/user-event'; const mockMgmtResponse = { distSpecVersion: '1.1.0-dev', binaryType: '-apikey-lint-metrics-mgmt-scrub-search-sync-ui-userprefs', - http: { auth: { htpasswd: {} } } + http: { auth: { htpasswd: {}, openid: { providers: { github: {} } } } } }; // useNavigate mock @@ -55,6 +55,7 @@ describe('Sign in form', () => { fireEvent.change(passwordInput, { target: { value: 'test' } }); expect(usernameInput).toHaveValue('test'); expect(passwordInput).toHaveValue('test'); + expect(screen.getByTestId('openid-divider')).toBeInTheDocument(); }); it('should display error if username and password values are empty after change', async () => { diff --git a/src/components/Login/SignIn.jsx b/src/components/Login/SignIn.jsx index f1f197ea..78b92156 100644 --- a/src/components/Login/SignIn.jsx +++ b/src/components/Login/SignIn.jsx @@ -312,7 +312,13 @@ export default function SignIn({ isLoggedIn, setIsLoggedIn, wrapperSetLoading = Welcome back! Please login. {renderThirdPartyLoginMethods()} - {Object.keys(authMethods).length > 1 && or} + {Object.keys(authMethods).length > 1 && + Object.keys(authMethods).includes('openid') && + Object.keys(authMethods.openid.providers).length > 0 && ( + + or + + )} {Object.keys(authMethods).includes('htpasswd') && (