mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
Added more tests
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { FormFieldModel } from '../models/form-field.model';
|
||||
import { DynamicConcatModel } from '../ds-dynamic-form-ui/models/ds-dynamic-concat.model';
|
||||
import { SeriesFieldParser } from './series-field-parser';
|
||||
import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model';
|
||||
|
||||
describe('SeriesFieldParser test suite', () => {
|
||||
let field: FormFieldModel;
|
||||
let initFormValues: any = {};
|
||||
|
||||
const initFormValues = {};
|
||||
const readOnly = false;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -47,4 +48,17 @@ describe('SeriesFieldParser test suite', () => {
|
||||
expect((fieldModel as DynamicConcatModel).separator).toBe('; ');
|
||||
});
|
||||
|
||||
it('should set init value properly', () => {
|
||||
initFormValues = {
|
||||
series: [new FormFieldMetadataValueObject('test; series')],
|
||||
};
|
||||
const expectedValue = new FormFieldMetadataValueObject('test; series');
|
||||
|
||||
const parser = new SeriesFieldParser(field, initFormValues, readOnly);
|
||||
|
||||
const fieldModel = parser.parse();
|
||||
|
||||
expect(fieldModel.value).toEqual(expectedValue);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user