Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5137: Fix the accidental change of the complete month issue with the test cases by selecting to a earlier date in a month #33

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/test/datepicker_test.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1615,8 +1615,12 @@ describe("DatePicker", () => {
});

it("should be possible to preSelect minDate (no maxDate set)", () => {
const minDate = new Date("2024-10-02");
const selected = minDate;

const data = getOnInputKeyDownStuff({
minDate: newDate(),
selected,
minDate,
});
fireEvent.keyDown(data.dateInput, getKey(KeyType.ArrowDown));
const selectedDayNode = getSelectedDayNode(data.container);
Expand All @@ -1632,9 +1636,14 @@ describe("DatePicker", () => {
});

it("should be possible to preSelect minDate (maxDate set)", () => {
const minDate = new Date("2024-10-02");
const maxDate = addDays(minDate, 20);
const selected = minDate;

const data = getOnInputKeyDownStuff({
minDate: newDate(),
maxDate: addDays(newDate(), 20),
selected,
minDate,
maxDate,
});
fireEvent.keyDown(data.dateInput, getKey(KeyType.ArrowDown));
const selectedDayNode = getSelectedDayNode(data.container);
Expand Down
Loading