Skip to content

Commit

Permalink
ACS-7747 Fix flaky test (#10131)
Browse files Browse the repository at this point in the history
* ACS-7747 Fix flaky test

* ACS-7747 Fix flaky test, apply pr remark
  • Loading branch information
tomson7777 authored Aug 29, 2024
1 parent efaa35d commit bed18d8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ describe('SearchDateRangeComponent', () => {
expect(component.form.controls.betweenEndDate.errors.invalidDate).toBeTrue();
});

// TODO: very flaky test, to be refactored
// eslint-disable-next-line ban/ban
xit('should not be able to select a date after the max date when selecting the BETWEEN option', async () => {
it('should not be able to select a date after the max date when selecting the BETWEEN option', async () => {
component.form.controls.dateRangeType.setValue(component.DateRangeType.BETWEEN);
component.maxDate = 'today';
fixture.detectChanges();
Expand All @@ -188,7 +186,7 @@ describe('SearchDateRangeComponent', () => {

const calendar = await loader.getHarness(MatCalendarHarness);

const afterDate = format(addDays(new Date(), 1), 'MMM d, yyyy');
const afterDate = format(addDays(new Date().getTime(), 1), 'MMM d, yyyy');
const cell = await calendar.getCells({ disabled: true });
expect(await cell[0].getAriaLabel()).toEqual(afterDate);
});
Expand Down

0 comments on commit bed18d8

Please sign in to comment.