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

[datetime] chore: fix tests which used year 2020 #3916

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/datetime/test/datePickerCaptionTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe("<DatePickerCaption>", () => {
date={new Date(2015, 0)}
locale="en"
localeUtils={LOCALE_UTILS}
maxDate={new Date(2020, 0)}
maxDate={new Date(2030, 0)}
minDate={new Date(2010, 0)}
months={undefined}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/datetime/test/dateRangeInputTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe("<DateRangeInput>", () => {
const INVALID_MESSAGE = "Custom invalid-date message";

const OUT_OF_RANGE_TEST_MIN = new Date(2000, 1, 1);
const OUT_OF_RANGE_TEST_MAX = new Date(2020, 1, 1);
const OUT_OF_RANGE_TEST_MAX = new Date(2030, 1, 1);
const OUT_OF_RANGE_START_DATE = new Date(1000, 1, 1);
const OUT_OF_RANGE_START_STR = DateTestUtils.toDateString(OUT_OF_RANGE_START_DATE);
const OUT_OF_RANGE_END_DATE = new Date(3000, 1, 1);
Expand Down
8 changes: 4 additions & 4 deletions packages/datetime/test/dateRangePickerTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,20 +290,20 @@ describe("<DateRangePicker>", () => {
it("is initialMonth if set", () => {
const defaultValue = [new Date(2007, Months.APRIL, 4), null] as DateRange;
const initialMonth = new Date(2002, Months.MARCH, 1);
const maxDate = new Date(2020, Months.JANUARY);
const maxDate = new Date(2030, Months.JANUARY);
const minDate = new Date(2000, Months.JANUARY);
render({ defaultValue, initialMonth, maxDate, minDate }).left.assertMonthYear(Months.MARCH, 2002);
});

it("is defaultValue if set and initialMonth not set", () => {
const defaultValue = [new Date(2007, Months.APRIL, 4), null] as DateRange;
const maxDate = new Date(2020, Months.JANUARY);
const maxDate = new Date(2030, Months.JANUARY);
const minDate = new Date(2000, Months.JANUARY);
render({ defaultValue, maxDate, minDate }).left.assertMonthYear(Months.APRIL, 2007);
});

it("is value if set and initialMonth not set", () => {
const maxDate = new Date(2020, Months.JANUARY);
const maxDate = new Date(2030, Months.JANUARY);
const minDate = new Date(2000, Months.JANUARY);
const value = [new Date(2007, Months.APRIL, 4), null] as DateRange;
render({ maxDate, minDate, value }).left.assertMonthYear(Months.APRIL, 2007);
Expand All @@ -328,7 +328,7 @@ describe("<DateRangePicker>", () => {
});

it("is today if only maxDate/minDate set and today is in date range", () => {
const maxDate = new Date(2020, Months.JANUARY);
const maxDate = new Date(2030, Months.JANUARY);
const minDate = new Date(2000, Months.JANUARY);
const today = new Date();
render({ maxDate, minDate }).left.assertMonthYear(today.getMonth(), today.getFullYear());
Expand Down