Turn off auto completion on the login form (#13471)

This commit is contained in:
Michael Abashian
2023-03-16 07:03:48 -04:00
committed by GitHub
parent 5d0849d746
commit 790ccd984c
2 changed files with 9 additions and 0 deletions

View File

@@ -208,6 +208,7 @@ function AWXLogin({ alt, isAuthenticated }) {
> >
{(formik) => ( {(formik) => (
<LoginForm <LoginForm
autoComplete="off"
data-cy="login-form" data-cy="login-form"
className={authError ? 'pf-m-error' : ''} className={authError ? 'pf-m-error' : ''}
helperText={helperText} helperText={helperText}

View File

@@ -115,6 +115,14 @@ describe('<Login />', () => {
); );
}); });
test.only('form has autocomplete off', async () => {
let wrapper;
await act(async () => {
wrapper = mountWithContexts(<AWXLogin isAuthenticated={() => false} />);
});
expect(wrapper.find('form[autoComplete="off"]').length).toBe(1);
});
test('custom logo renders Brand component with correct src and alt', async () => { test('custom logo renders Brand component with correct src and alt', async () => {
let wrapper; let wrapper;
await act(async () => { await act(async () => {