Skip to content
Snippets Groups Projects
Verified Commit 21337e8c authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-7591 add tests

parent e45895e9
No related branches found
No related tags found
1 merge request!92Administration: Validierung der Pflichtfelder bei "Benutzer & Rollen"
...@@ -62,6 +62,34 @@ describe('UserFormRolesComponent', () => { ...@@ -62,6 +62,34 @@ describe('UserFormRolesComponent', () => {
control.setErrors(null); control.setErrors(null);
}); });
it('should mark as invalid', (done) => {
const invalidParam: InvalidParam = createInvalidParam();
const error: any = { dummy: invalidParam };
const control: AbstractControl = new FormControl();
component.formGroupParent = new UntypedFormGroup({ [UserFormService.CLIENT_ROLES]: control });
component.ngOnInit();
component.invalidParams$.subscribe(() => {
expect(component.isValid).toBe(false);
done();
});
control.setErrors(error);
});
it('should mark as valid', (done) => {
const control: AbstractControl = new FormControl();
component.formGroupParent = new UntypedFormGroup({ [UserFormService.CLIENT_ROLES]: control });
component.ngOnInit();
component.invalidParams$.subscribe(() => {
expect(component.isValid).toBe(true);
done();
});
control.setErrors(null);
});
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment