Skip to content

Commit

Permalink
🧪 Fix the test case failing issue by setting the selected date to be …
Browse files Browse the repository at this point in the history
…same as the configured least possible month date

Closes #5252
  • Loading branch information
Balaji-Sridharan_NYULH authored and Balaji-Sridharan_NYULH committed Dec 1, 2024
1 parent 2452507 commit 04dc46f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/test/calendar_test.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,17 @@ describe("Calendar", () => {
});

it("should not have previous month button when selecting a date in the second month, when min date is specified", () => {
const minDate = new Date("2024-11-06");
const maxDate = new Date("2025-01-01");
const selectedDate = minDate;

const { container } = render(
<DatePicker
inline
monthsShown={2}
minDate={new Date("2024-11-06")}
maxDate={new Date("2025-01-01")}
selected={selectedDate}
minDate={minDate}
maxDate={maxDate}
/>,
);

Expand Down

0 comments on commit 04dc46f

Please sign in to comment.