mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
99053: Added test to check that the TYPE_REQUEST_FORGOT doesn't use the authentication-password.domain.valid
This commit is contained in:
@@ -74,15 +74,6 @@ describe('RegisterEmailFormComponent', () => {
|
|||||||
const elem = fixture.debugElement.queryAll(By.css('input#email'))[0].nativeElement;
|
const elem = fixture.debugElement.queryAll(By.css('input#email'))[0].nativeElement;
|
||||||
expect(elem).toBeDefined();
|
expect(elem).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not retrieve the validDomains for TYPE_REQUEST_FORGOT', () => {
|
|
||||||
spyOn(configurationDataService, 'findByPropertyName');
|
|
||||||
comp.typeRequest = TYPE_REQUEST_FORGOT;
|
|
||||||
|
|
||||||
comp.ngOnInit();
|
|
||||||
|
|
||||||
expect(configurationDataService.findByPropertyName).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
describe('email validation', () => {
|
describe('email validation', () => {
|
||||||
it('should be invalid when no email is present', () => {
|
it('should be invalid when no email is present', () => {
|
||||||
@@ -96,6 +87,18 @@ describe('RegisterEmailFormComponent', () => {
|
|||||||
comp.form.patchValue({email: 'valid@email.org'});
|
comp.form.patchValue({email: 'valid@email.org'});
|
||||||
expect(comp.form.invalid).toBeFalse();
|
expect(comp.form.invalid).toBeFalse();
|
||||||
});
|
});
|
||||||
|
it('should accept email with other domain names on TYPE_REQUEST_FORGOT form', () => {
|
||||||
|
spyOn(configurationDataService, 'findByPropertyName').and.returnValue(createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
|
name: 'authentication-password.domain.valid',
|
||||||
|
values: ['marvel.com'],
|
||||||
|
})));
|
||||||
|
comp.typeRequest = TYPE_REQUEST_FORGOT;
|
||||||
|
|
||||||
|
comp.ngOnInit();
|
||||||
|
|
||||||
|
comp.form.patchValue({ email: 'valid@email.org' });
|
||||||
|
expect(comp.form.invalid).toBeFalse();
|
||||||
|
});
|
||||||
it('should not accept email with other domain names', () => {
|
it('should not accept email with other domain names', () => {
|
||||||
spyOn(configurationDataService, 'findByPropertyName').and.returnValue(createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
spyOn(configurationDataService, 'findByPropertyName').and.returnValue(createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
name: 'authentication-password.domain.valid',
|
name: 'authentication-password.domain.valid',
|
||||||
|
Reference in New Issue
Block a user