Skip to content

Commit 0e63223

Browse files
Merge pull request #5253 from qburst/issue-5252/fix/month-navigation-test-case
🧪 Fix the test case failing issue by setting the selected date to be same as the configured least possible month date
2 parents 2452507 + 04dc46f commit 0e63223

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/calendar_test.test.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,17 @@ describe("Calendar", () => {
449449
});
450450

451451
it("should not have previous month button when selecting a date in the second month, when min date is specified", () => {
452+
const minDate = new Date("2024-11-06");
453+
const maxDate = new Date("2025-01-01");
454+
const selectedDate = minDate;
455+
452456
const { container } = render(
453457
<DatePicker
454458
inline
455459
monthsShown={2}
456-
minDate={new Date("2024-11-06")}
457-
maxDate={new Date("2025-01-01")}
460+
selected={selectedDate}
461+
minDate={minDate}
462+
maxDate={maxDate}
458463
/>,
459464
);
460465

0 commit comments

Comments
 (0)