mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
add submissionId to fieldparser, and refactor to create fieldparsers using DI
This commit is contained in:
@@ -8,6 +8,7 @@ describe('SeriesFieldParser test suite', () => {
|
||||
let field: FormFieldModel;
|
||||
let initFormValues: any = {};
|
||||
|
||||
const submissionId = '1234';
|
||||
const parserOptions: ParserOptions = {
|
||||
readOnly: false,
|
||||
submissionScope: 'testScopeUUID',
|
||||
@@ -32,13 +33,13 @@ describe('SeriesFieldParser test suite', () => {
|
||||
});
|
||||
|
||||
it('should init parser properly', () => {
|
||||
const parser = new SeriesFieldParser(field, initFormValues, parserOptions);
|
||||
const parser = new SeriesFieldParser(submissionId, field, initFormValues, parserOptions);
|
||||
|
||||
expect(parser instanceof SeriesFieldParser).toBe(true);
|
||||
});
|
||||
|
||||
it('should return a DynamicConcatModel object when repeatable option is false', () => {
|
||||
const parser = new SeriesFieldParser(field, initFormValues, parserOptions);
|
||||
const parser = new SeriesFieldParser(submissionId, field, initFormValues, parserOptions);
|
||||
|
||||
const fieldModel = parser.parse();
|
||||
|
||||
@@ -46,7 +47,7 @@ describe('SeriesFieldParser test suite', () => {
|
||||
});
|
||||
|
||||
it('should return a DynamicConcatModel object with the correct separator', () => {
|
||||
const parser = new SeriesFieldParser(field, initFormValues, parserOptions);
|
||||
const parser = new SeriesFieldParser(submissionId, field, initFormValues, parserOptions);
|
||||
|
||||
const fieldModel = parser.parse();
|
||||
|
||||
@@ -59,7 +60,7 @@ describe('SeriesFieldParser test suite', () => {
|
||||
};
|
||||
const expectedValue = new FormFieldMetadataValueObject('test; series');
|
||||
|
||||
const parser = new SeriesFieldParser(field, initFormValues, parserOptions);
|
||||
const parser = new SeriesFieldParser(submissionId, field, initFormValues, parserOptions);
|
||||
|
||||
const fieldModel = parser.parse();
|
||||
|
||||
|
Reference in New Issue
Block a user