diff --git a/src/app/profile-page/profile-page.component.spec.ts b/src/app/profile-page/profile-page.component.spec.ts index 6893ac2437..bd85448566 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -228,6 +228,23 @@ describe('ProfilePageComponent', () => { expect(epersonService.patch).toHaveBeenCalledWith(user, operations); }); }); + + describe('when password is filled in, and is weak', () => { + let result; + let operations; + + it('should return call epersonService.patch', () => { + (epersonService.patch as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Error', 422)); + component.setPasswordValue('testest'); + + component.setInvalid(false); + operations = [{ op: 'add', path: '/password', value: 'testest' }]; + result = component.updateSecurity(); + expect(result).toEqual(true); + expect(epersonService.patch).toHaveBeenCalledWith(user, operations); + expect(component.isRobustPasswordError.value).toBeTrue(); + }); + }); }); describe('canChangePassword$', () => { diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index bf5ccb4f06..353912a6b7 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -3056,7 +3056,7 @@ "profile.security.form.notifications.error.not-same": "The provided passwords are not the same.", - "profile.security.form.notifications.error.robust-password": "Please select a more robust password.", + "profile.security.form.error.robust-password": "Please select a more robust password.", "profile.title": "Update Profile",