[ACS-5857] resolved unit tests

This commit is contained in:
SheenaMalhotra182
2023-09-20 15:44:58 +05:30
parent cc7b3f39c6
commit e91bfb56e2
2 changed files with 5 additions and 5 deletions
@@ -113,7 +113,7 @@ describe('Form Renderer Component', () => {
fixture.destroy(); 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 () => { 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); formRendererComponent.formDefinition = formService.parseForm(formDateVisibility.formRepresentation.formDefinition);
fixture.detectChanges(); fixture.detectChanges();
@@ -293,8 +293,8 @@ describe('DateWidgetComponent', () => {
await fixture.whenStable(); await fixture.whenStable();
const todayDate = new Date(); const todayDate = new Date();
const expected = subDays(todayDate, widget.field.minDateRangeValue); const expected = format(subDays(todayDate, widget.field.minDateRangeValue), widget.DATE_FORMAT);
expect(widget.minDate).toEqual(format(expected, 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 () => { 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(); await fixture.whenStable();
const todayDate = new Date(); const todayDate = new Date();
const expected = addDays(todayDate, widget.field.maxDateRangeValue); const expected = format(addDays(todayDate, widget.field.maxDateRangeValue), widget.DATE_FORMAT);
expect(widget.maxDate).toEqual(format(expected, widget.DATE_FORMAT)); expect(widget.maxDate).toEqual(expected);
}); });
it('should maxDate and minDate be undefined if minDateRangeValue and maxDateRangeValue are null', async () => { it('should maxDate and minDate be undefined if minDateRangeValue and maxDateRangeValue are null', async () => {