diff --git a/src/app/submission/sections/form/section-form.component.spec.ts b/src/app/submission/sections/form/section-form.component.spec.ts index b877771b73..cf16cc9317 100644 --- a/src/app/submission/sections/form/section-form.component.spec.ts +++ b/src/app/submission/sections/form/section-form.component.spec.ts @@ -266,6 +266,7 @@ describe('FormSectionComponent test suite', () => { it('should set a section Error when init form model fails', () => { formBuilderService.modelFromConfiguration.and.throwError('test'); + translateService.instant.and.returnValue('test'); const sectionData = {}; const sectionError: SubmissionSectionError = { message: 'test' + 'Error: test', diff --git a/src/app/submission/sections/form/section-form.component.ts b/src/app/submission/sections/form/section-form.component.ts index a62c52f634..6ed91782d0 100644 --- a/src/app/submission/sections/form/section-form.component.ts +++ b/src/app/submission/sections/form/section-form.component.ts @@ -201,9 +201,9 @@ export class FormSectionComponent extends SectionModelComponent { sectionData, this.submissionService.getSubmissionScope()); } catch (e) { - const msg = this.translate.instant('error.submission.sections.init-form-error'); + const msg: string = this.translate.instant('error.submission.sections.init-form-error') + e.toString(); const sectionError: SubmissionSectionError = { - message: msg + e.toString(), + message: msg, path: '/sections/' + this.sectionData.id }; this.sectionService.setSectionError(this.submissionId, this.sectionData.id, sectionError);