Skip to content

Commit

Permalink
Added test to check if the previous month button is enabled if the cu…
Browse files Browse the repository at this point in the history
…rrent month is after the minDate month prop
  • Loading branch information
yulric committed Oct 7, 2015
1 parent 93117f2 commit 38ba818
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/date-picker/calendar-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,20 @@ describe(`Calendar`, () => {

expect(calendarToolbar.props.prevMonth).to.be.false;
});

it(`should enable the previous month button if the current month is after the minDate month prop`, () => {
let initialDate = new Date();
let minDate = new Date(initialDate.toDateString());
minDate.setMonth(initialDate.getMonth() - 1);

let render = TestUtils.renderIntoDocument(
<ThemedCalendar
initialDate={initialDate}
minDate={minDate}
/>
);
let calendarToolbar = TestUtils.findRenderedComponentWithType(render, CalendarToolbar);

expect(calendarToolbar.props.prevMonth).to.be.true;
});
});

0 comments on commit 38ba818

Please sign in to comment.