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

[DatePicker] Fix tests for the 31 of October #2022

Merged
merged 1 commit into from
Oct 31, 2015
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
32 changes: 16 additions & 16 deletions test/date-picker/calendar-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(`Calendar`, () => {

describe(`Next Month Button`, () => {
it(`should initially be disabled if the current month is the same as the month in the maxDate prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let maxDate = new Date(initialDate.toDateString());

let render = TestUtils.renderIntoDocument(
Expand All @@ -38,9 +38,9 @@ describe(`Calendar`, () => {
});

it(`should initially be disabled if the current month is after the month in the maxDate prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let maxDate = new Date(initialDate.toDateString());
maxDate.setMonth(maxDate.getMonth() - 1);
maxDate = DateTime.addMonths(maxDate, -1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
Expand All @@ -56,9 +56,9 @@ describe(`Calendar`, () => {
});

it(`should initially enable the next month button if the current month is before the maxDate prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let maxDate = new Date(initialDate.toDateString());
maxDate.setMonth(maxDate.getMonth() + 1);
maxDate = DateTime.addMonths(maxDate, 1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
Expand All @@ -75,7 +75,7 @@ describe(`Calendar`, () => {
});

it(`should reenable the next month button when the current month is before the maxDate prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let maxDate = new Date(initialDate.toDateString());

let render = TestUtils.renderIntoDocument(
Expand All @@ -96,9 +96,9 @@ describe(`Calendar`, () => {
});

it(`should redisable the next month button when the current month is the same as the maxDate prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let maxDate = new Date(initialDate.toDateString());
maxDate.setMonth(maxDate.getMonth() + 1);
maxDate = DateTime.addMonths(maxDate, 1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
Expand All @@ -120,7 +120,7 @@ describe(`Calendar`, () => {

describe('Previous Month Button', () => {
it(`should initially disable the previous month button if the current month is the same as the minDate month prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let minDate = new Date(initialDate.toDateString());

let render = TestUtils.renderIntoDocument(
Expand All @@ -137,9 +137,9 @@ describe(`Calendar`, () => {
});

it(`should initially disable the previous month button if the current month is before the minDate month prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let minDate = new Date(initialDate.toDateString());
minDate.setMonth(initialDate.getMonth() + 1);
minDate = DateTime.addMonths(initialDate, 1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
Expand All @@ -155,9 +155,9 @@ describe(`Calendar`, () => {
});

it(`should initially enable the previous month button if the current month is after the minDate month prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let minDate = new Date(initialDate.toDateString());
minDate.setMonth(initialDate.getMonth() - 1);
minDate = DateTime.addMonths(initialDate, -1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
Expand All @@ -173,7 +173,7 @@ describe(`Calendar`, () => {
});

it(`should enable the previous month button when the current month is after the minDate month prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let minDate = new Date(initialDate.toDateString());

let render = TestUtils.renderIntoDocument(
Expand All @@ -193,9 +193,9 @@ describe(`Calendar`, () => {
});

it(`should disable the previous month button when the current month is the same as the minDate month prop`, () => {
let initialDate = new Date();
let initialDate = new Date(1448967059892); // Tue, 01 Dec 2015 10:50:59 GMT
let minDate = new Date(initialDate.toDateString());
minDate.setMonth(minDate.getMonth() - 1);
minDate = DateTime.addMonths(minDate, -1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
Expand Down