From 9bddaf637cf3be0502fcba86a505ab9b64e0a543 Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Thu, 3 Mar 2022 18:44:55 +0100 Subject: [PATCH] 87968: Fix unit tests --- .../ds-dynamic-form-control-container.component.spec.ts | 2 ++ src/app/shared/form/builder/form-builder.service.spec.ts | 2 +- .../claimed-task/claimed-task-actions.component.spec.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts index 73b93ad8279..b4d7ea75f33 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts @@ -77,6 +77,7 @@ import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; import { FormService } from '../../form.service'; import { SubmissionService } from '../../../../submission/submission.service'; import { FormBuilderService } from '../form-builder.service'; +import { NgxMaskModule } from 'ngx-mask'; describe('DsDynamicFormControlContainerComponent test suite', () => { @@ -194,6 +195,7 @@ describe('DsDynamicFormControlContainerComponent test suite', () => { DynamicFormsCoreModule.forRoot(), SharedModule, TranslateModule.forRoot(), + NgxMaskModule.forRoot(), ], providers: [ DsDynamicFormControlContainerComponent, diff --git a/src/app/shared/form/builder/form-builder.service.spec.ts b/src/app/shared/form/builder/form-builder.service.spec.ts index cea4d7df6e7..4055c84921e 100644 --- a/src/app/shared/form/builder/form-builder.service.spec.ts +++ b/src/app/shared/form/builder/form-builder.service.spec.ts @@ -104,7 +104,7 @@ describe('FormBuilderService test suite', () => { new DynamicInputModel( { id: 'testInput', - mask: ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], + mask: '(000) 000-0000', } ), diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index fcaa2f455a9..5e6938853a0 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -170,7 +170,7 @@ describe('ClaimedTaskActionsComponent', () => { fixture.whenStable().then(() => { const debugElement = fixture.debugElement.query(By.css('.workflow-view')); expect(debugElement).toBeTruthy(); - expect(debugElement.nativeElement.innerText).toBe('submission.workflow.generic.view'); + expect(debugElement.nativeElement.innerText.trim()).toBe('submission.workflow.generic.view'); }); }));