Skip to content

Commit 252c249

Browse files
[DURACOM-426] fix test and model update
1 parent efc488a commit 252c249

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom
154154
* Retrieve vocabulary object
155155
*/
156156
initVocabulary(): void {
157+
if (this.model.value) {
158+
this.setCurrentValue(this.model.value, true);
159+
}
157160
this.vocabulary$ = this.vocabularyService.findVocabularyById(this.model.vocabularyOptions.name).pipe(
158161
getFirstSucceededRemoteDataPayload(),
159162
distinctUntilChanged(),

src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ describe('DsDynamicOneboxComponent test suite', () => {
395395

396396
it('should init component properly', fakeAsync(() => {
397397
tick();
398-
expect(oneboxComponent.currentValue).toEqual(new FormFieldMetadataValueObject('test001', null, validAuthority, 'test'));
398+
expect(oneboxComponent.currentValue).toEqual(new FormFieldMetadataValueObject('test', null, validAuthority, 'test001'));
399399
expect((oneboxComponent as any).vocabularyService.getVocabularyEntryByID).toHaveBeenCalled();
400400
}));
401401

src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
357357
if (isEmpty(value)) {
358358
result = '';
359359
} else {
360-
result = value.value;
360+
result = value;
361361
}
362362
this.currentValue = null;
363363
this.cdr.detectChanges();

0 commit comments

Comments
 (0)