diff --git a/test/components/DayPickerRangeController_spec.jsx b/test/components/DayPickerRangeController_spec.jsx index 55734c7b0..c87c87086 100644 --- a/test/components/DayPickerRangeController_spec.jsx +++ b/test/components/DayPickerRangeController_spec.jsx @@ -3693,6 +3693,40 @@ describe('DayPickerRangeController', () => { }); }); + describe.only('#onMonchChange', () => { + it('sets disableNext as false when maxDate is in visible month and a past month is selected', () => { + const wrapper = shallow(( + + )); + wrapper.setState({ + currentMonth: today, + }); + expect(wrapper.state().disableNext).to.equal(true); + wrapper.instance().onMonthChange(today.clone().subtract(1, 'month')); + expect(wrapper.state().disableNext).to.equal(false); + }); + + it('sets disablePrev as false when minDate is in visible month and a future month is selected', () => { + const wrapper = shallow(( + + )); + wrapper.setState({ + currentMonth: today, + }); + expect(wrapper.state().disablePrev).to.equal(true); + wrapper.instance().onMonthChange(today.clone().add(1, 'month')); + expect(wrapper.state().disablePrev).to.equal(false); + }); + }); + describe('#getFirstFocusableDay', () => { describe('focusedInput === START_DATE', () => { it('returns startDate if exists and is not blocked', () => {