mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 12:03:03 +00:00
[835] Auto-save in new Item Submission form breaks the form
Tests fixed.
This commit is contained in:
@@ -287,6 +287,7 @@ describe('SubmissionSectionformComponent test suite', () => {
|
||||
'dc.title': [new FormFieldMetadataValueObject('test')]
|
||||
};
|
||||
compAsAny.formData = {};
|
||||
compAsAny.sectionMetadata = ['dc.title'];
|
||||
|
||||
expect(comp.hasMetadataEnrichment(newSectionData)).toBeTruthy();
|
||||
});
|
||||
@@ -296,7 +297,7 @@ describe('SubmissionSectionformComponent test suite', () => {
|
||||
'dc.title': [new FormFieldMetadataValueObject('test')]
|
||||
};
|
||||
compAsAny.formData = newSectionData;
|
||||
|
||||
compAsAny.sectionMetadata = ['dc.title'];
|
||||
expect(comp.hasMetadataEnrichment(newSectionData)).toBeFalsy();
|
||||
});
|
||||
|
||||
@@ -310,6 +311,7 @@ describe('SubmissionSectionformComponent test suite', () => {
|
||||
comp.sectionData.data = {};
|
||||
comp.sectionData.errors = [];
|
||||
compAsAny.formData = {};
|
||||
compAsAny.sectionMetadata = ['dc.title'];
|
||||
|
||||
comp.updateForm(sectionData, sectionError);
|
||||
|
||||
@@ -329,10 +331,11 @@ describe('SubmissionSectionformComponent test suite', () => {
|
||||
comp.sectionData.data = {};
|
||||
comp.sectionData.errors = [];
|
||||
compAsAny.formData = sectionData;
|
||||
compAsAny.sectionMetadata = ['dc.title'];
|
||||
|
||||
comp.updateForm(sectionData, parsedSectionErrors);
|
||||
|
||||
expect(comp.initForm).toHaveBeenCalled();
|
||||
expect(comp.initForm).not.toHaveBeenCalled();
|
||||
expect(comp.checksForErrors).toHaveBeenCalled();
|
||||
expect(comp.sectionData.data).toEqual(sectionData);
|
||||
});
|
||||
|
Reference in New Issue
Block a user