Skip to content

Commit

Permalink
[datetime2] fix failing tests, use Tokyo timezone (#6055)
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya authored Apr 3, 2023
1 parent 8f96a84 commit ef21607
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/datetime2/test/components/dateInput2Tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,18 @@ describe("<DateInput2>", () => {
it("before selecting a date", () => {
const wrapper = mount(<DateInput2 {...DEFAULT_PROPS} />, { attachTo: containerElement });
focusInput(wrapper);
clickTimezoneItem(wrapper, "Paris");
assertTimezoneIsSelected(wrapper, "GMT+1");
// Japan is one of the few countries that does not have any kind of daylight savings, so this unit test
// keeps working all year round
clickTimezoneItem(wrapper, "Tokyo");
assertTimezoneIsSelected(wrapper, "GMT+9");
});

it("after selecting a date", () => {
const wrapper = mount(<DateInput2 {...DEFAULT_PROPS} />, { attachTo: containerElement });
focusInput(wrapper);
clickCalendarDay(wrapper, 1);
clickTimezoneItem(wrapper, "Paris");
assertTimezoneIsSelected(wrapper, "GMT+1");
clickTimezoneItem(wrapper, "Tokyo");
assertTimezoneIsSelected(wrapper, "GMT+9");
});
});
});
Expand Down Expand Up @@ -686,14 +688,14 @@ describe("<DateInput2>", () => {

it("updates the displayed timezone", () => {
const wrapper = mount(<DateInput2 {...DEFAULT_PROPS_CONTROLLED} />, { attachTo: containerElement });
clickTimezoneItem(wrapper, "Paris");
assertTimezoneIsSelected(wrapper, "GMT+1");
clickTimezoneItem(wrapper, "Tokyo");
assertTimezoneIsSelected(wrapper, "GMT+9");
});

it("before selecting a date (initial value={null})", () => {
const wrapper = mount(<DateInput2 {...DEFAULT_PROPS} value={null} />, { attachTo: containerElement });
clickTimezoneItem(wrapper, "Paris");
assertTimezoneIsSelected(wrapper, "GMT+1");
clickTimezoneItem(wrapper, "Tokyo");
assertTimezoneIsSelected(wrapper, "GMT+9");
});
});
});
Expand Down

1 comment on commit ef21607

@adidahiya
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[datetime2] fix failing tests, use Tokyo timezone (#6055)

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.