Skip to content

Commit

Permalink
[datetime] chore: fix tests which used year 2020 (#3916)
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Jan 9, 2020
1 parent df9fdc1 commit e780270
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

1 comment on commit e780270

@blueprint-bot
Copy link

Choose a reason for hiding this comment

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

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

Previews: documentation | landing | table

Please sign in to comment.