From b9dfe70f4d98fd1cd6f8c71b8027c4284a7668d0 Mon Sep 17 00:00:00 2001 From: SheenaMalhotra182 Date: Thu, 24 Aug 2023 14:18:48 +0530 Subject: [PATCH] [ACS-5857] fixed code smell due to nested template literals --- .../form/components/widgets/core/form-field.model.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/src/lib/form/components/widgets/core/form-field.model.spec.ts b/lib/core/src/lib/form/components/widgets/core/form-field.model.spec.ts index 5ab4b1926b..2397cf4453 100644 --- a/lib/core/src/lib/form/components/widgets/core/form-field.model.spec.ts +++ b/lib/core/src/lib/form/components/widgets/core/form-field.model.spec.ts @@ -305,8 +305,11 @@ describe('FormFieldModel', () => { }); const currentDateTime = new Date(); + const formattedDate = format(currentDateTime, 'yyyy-MM-dd'); + const formattedTime = format(currentDateTime, 'hh:mm'); + const expectedDateTime = format(currentDateTime, 'yyyy-MM-dd hh:mm'); - const expectedDateTimeFormat = `${format(currentDateTime, `yyyy-MM-dd'T'hh:mm`)}:00.000Z`; + const expectedDateTimeFormat = formattedDate + `T${formattedTime}:00.000Z`; expect(field.value).toBe(expectedDateTime); expect(form.values['datetime']).toEqual(expectedDateTimeFormat);