mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
[835] Auto-save in new Item Submission form breaks the form
Minor fixes and method computeSectionConfiguredMetadata tested
This commit is contained in:
@@ -380,4 +380,25 @@ describe('SectionsService test suite', () => {
|
||||
expect(store.dispatch).toHaveBeenCalledWith(new UpdateSectionDataAction(submissionId, sectionId, data, []));
|
||||
});
|
||||
});
|
||||
|
||||
describe('computeSectionConfiguredMetadata', () => {
|
||||
it('should return the configured metadata of the section from the form configuration', () => {
|
||||
|
||||
const formConfig = {
|
||||
rows: [{
|
||||
fields: [{
|
||||
selectableMetadata: [{
|
||||
metadata: 'dc.contributor.author'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
||||
const expectedConfiguredMetadata = [ 'dc.contributor.author' ];
|
||||
|
||||
const configuredMetadata = service.computeSectionConfiguredMetadata(formConfig as any);
|
||||
|
||||
expect(configuredMetadata).toEqual(expectedConfiguredMetadata);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user