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

Fix disabling navigation after minDate/maxDate change #2098

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ferrun
Copy link

@ferrun ferrun commented Mar 3, 2021

Fix for issue #2097

@ferrun
Copy link
Author

ferrun commented May 5, 2021

@ljharb can you review this request? 😄

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Seems good!

...props,
maxDate: moment().add(1, 'months'),
});
expect(wrapper.instance().state.disableNext).to.equal(false);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expect(wrapper.instance().state.disableNext).to.equal(false);
expect(wrapper.state()).to.have.property('disableNext', false);

...props,
maxDate: moment(),
});
expect(wrapper.instance().state.disableNext).to.equal(true);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expect(wrapper.instance().state.disableNext).to.equal(true);
expect(wrapper.state()).to.have.property('disableNext', true);

...props,
minDate: moment().subtract(1, 'months'),
});
expect(wrapper.instance().state.disablePrev).to.equal(false);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expect(wrapper.instance().state.disablePrev).to.equal(false);
expect(wrapper.state()).to.have.property('disablePrev', false);

...props,
minDate: moment(),
});
expect(wrapper.instance().state.disablePrev).to.equal(true);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expect(wrapper.instance().state.disablePrev).to.equal(true);
expect(wrapper.state()).to.have.property('disablePrev', true);

@ljharb ljharb added bug Oh no, something's broken :-( semver-patch: fixes/refactors/etc Anything that's not major or minor. labels May 5, 2021
@ferrun
Copy link
Author

ferrun commented May 5, 2021

@ljharb added your suggestions
Hmm.. why checks have failed? 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oh no, something's broken :-( semver-patch: fixes/refactors/etc Anything that's not major or minor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants