mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 03:23:07 +00:00
Fixed an issue with showing form error in FormSectionComponent and added comments
This commit is contained in:
@@ -318,6 +318,23 @@ describe('FormSectionComponent test suite', () => {
|
||||
|
||||
});
|
||||
|
||||
it('should update form error properly', () => {
|
||||
spyOn(comp, 'initForm');
|
||||
spyOn(comp, 'checksForErrors');
|
||||
const sectionData: any = {
|
||||
'dc.title': [new FormFieldMetadataValueObject('test')]
|
||||
};
|
||||
comp.sectionData.data = {};
|
||||
comp.sectionData.errors = [];
|
||||
compAsAny.formData = sectionData;
|
||||
|
||||
comp.updateForm(sectionData, parsedSectionErrors);
|
||||
|
||||
expect(comp.initForm).not.toHaveBeenCalled();
|
||||
expect(comp.checksForErrors).toHaveBeenCalled();
|
||||
expect(comp.sectionData.data).toEqual(sectionData);
|
||||
});
|
||||
|
||||
it('should update form error properly', () => {
|
||||
spyOn(comp, 'initForm');
|
||||
spyOn(comp, 'checksForErrors');
|
||||
|
Reference in New Issue
Block a user