AAE-23734 Fix flaky unit test - should set the date value to todays Date object when value is today (#9939)

This commit is contained in:
Tomasz Gnyp 2024-07-23 16:05:16 +02:00 committed by GitHub
parent 5165fd1433
commit dd03ae6617
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -277,7 +277,8 @@ describe('FormFieldModel', () => {
const currentDate = new Date();
const expectedDateFormat = `${DateFnsUtils.formatDate(currentDate, 'yyyy-MM-dd')}T00:00:00.000Z`;
expect(field.value).toEqual(currentDate);
expect(field.value.getDate()).toEqual(currentDate.getDate());
expect(field.value.getHours()).toEqual(currentDate.getHours());
expect(form.values['ddmmyyy']).toEqual(expectedDateFormat);
});