From e91bfb56e250c099c949e628ff7df528d50f1001 Mon Sep 17 00:00:00 2001 From: SheenaMalhotra182 Date: Thu, 17 Aug 2023 16:54:59 +0530 Subject: [PATCH] [ACS-5857] resolved unit tests --- .../lib/form/components/form-renderer.component.spec.ts | 2 +- .../components/widgets/date/date-cloud.widget.spec.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/src/lib/form/components/form-renderer.component.spec.ts b/lib/core/src/lib/form/components/form-renderer.component.spec.ts index 40b18a5134..cb759143a3 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.spec.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.spec.ts @@ -113,7 +113,7 @@ describe('Form Renderer Component', () => { fixture.destroy(); }); - describe('Display Date Widget ', async () => { + describe('Display Date Widget ', () => { it('Should be able to see a widget when the visibility condition refers to another fields with specific date', async () => { formRendererComponent.formDefinition = formService.parseForm(formDateVisibility.formRepresentation.formDefinition); fixture.detectChanges(); diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.spec.ts b/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.spec.ts index f921a10af2..02a6ef51d4 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/date/date-cloud.widget.spec.ts @@ -293,8 +293,8 @@ describe('DateWidgetComponent', () => { await fixture.whenStable(); const todayDate = new Date(); - const expected = subDays(todayDate, widget.field.minDateRangeValue); - expect(widget.minDate).toEqual(format(expected, widget.DATE_FORMAT)); + const expected = format(subDays(todayDate, widget.field.minDateRangeValue), widget.DATE_FORMAT); + expect(widget.minDate).toEqual(expected); }); it('should min date and max date be undefined if dynamic min and max date are not set', async () => { @@ -343,8 +343,8 @@ describe('DateWidgetComponent', () => { await fixture.whenStable(); const todayDate = new Date(); - const expected = addDays(todayDate, widget.field.maxDateRangeValue); - expect(widget.maxDate).toEqual(format(expected, widget.DATE_FORMAT)); + const expected = format(addDays(todayDate, widget.field.maxDateRangeValue), widget.DATE_FORMAT); + expect(widget.maxDate).toEqual(expected); }); it('should maxDate and minDate be undefined if minDateRangeValue and maxDateRangeValue are null', async () => {