mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
CST-6110 changes for robust password error
This commit is contained in:
@@ -238,6 +238,24 @@ describe('CreateProfileComponent', () => {
|
||||
expect(router.navigate).not.toHaveBeenCalled();
|
||||
expect(notificationsService.error).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should submit an eperson for creation but password is weak', () => {
|
||||
|
||||
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Error', 422));
|
||||
|
||||
comp.firstName.patchValue('First');
|
||||
comp.lastName.patchValue('Last');
|
||||
comp.contactPhone.patchValue('Phone');
|
||||
comp.language.patchValue('en');
|
||||
comp.password = 'password';
|
||||
comp.isInValidPassword = false;
|
||||
|
||||
comp.submitEperson();
|
||||
|
||||
expect(ePersonDataService.createEPersonForToken).toHaveBeenCalledWith(eperson, 'test-token');
|
||||
expect(comp.isRobustPasswordError.value).toBeTrue();
|
||||
});
|
||||
|
||||
it('should submit not create an eperson when the user info form is invalid', () => {
|
||||
|
||||
(ePersonDataService.createEPersonForToken as jasmine.Spy).and.returnValue(createFailedRemoteDataObject$('Error', 500));
|
||||
|
Reference in New Issue
Block a user