CST-6110 changes for robust password error

This commit is contained in:
nikunj59
2022-06-22 13:03:06 +05:30
parent 20975a2274
commit 17a89387f2
2 changed files with 18 additions and 1 deletions

View File

@@ -228,6 +228,23 @@ describe('ProfilePageComponent', () => {
expect(epersonService.patch).toHaveBeenCalledWith(user, operations); 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$', () => { describe('canChangePassword$', () => {

View File

@@ -3056,7 +3056,7 @@
"profile.security.form.notifications.error.not-same": "The provided passwords are not the same.", "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", "profile.title": "Update Profile",