Skip to content

Commit

Permalink
test: fix range calendar broken tests for today (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraghazra authored Oct 15, 2020
1 parent 4ed8904 commit 0512adb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/calendar/__tests__/RangeCalendar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ describe("RangeCalendar", () => {
it("should have proper initial start and end ranges", () => {
const { getByLabelText: label, baseElement } = render(
<RangeCalendarComp
defaultValue={{ start: "2020-10-07", end: "2020-10-30" }}
defaultValue={{ start: "2050-10-07", end: "2050-10-30" }}
/>,
);

const start = baseElement.querySelector("[data-is-selection-start]");
const anyMiddleDate = label("Thursday, October 15, 2020");
// If anyone is reading this code from future
// Note that this will fail again on 15th october 2050.
const anyMiddleDate = label("Saturday, October 15, 2050");
const end = baseElement.querySelector("[data-is-selection-end]");

expect(start).toHaveTextContent("7");
Expand Down

0 comments on commit 0512adb

Please sign in to comment.