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 on change validation #1919

Merged
merged 1 commit into from Feb 5, 2020
Merged

Conversation

@mmarkelov
Copy link
Contributor

mmarkelov commented Feb 3, 2020

Fix #1915

Just pass isDayBlocked prop to inputs controllers to add some extra check

Copy link
Collaborator

ljharb left a comment

there's 4 components changed, and only 1 of them has tests - can you add tests for the other 3?

@mmarkelov mmarkelov requested a review from ljharb Feb 4, 2020
@ljharb

This comment has been minimized.

Copy link
Collaborator

ljharb commented Feb 4, 2020

I still only see tests for the controllers, but no unit tests for the (now, 5) individual changed components.

@mmarkelov

This comment has been minimized.

Copy link
Contributor Author

mmarkelov commented Feb 5, 2020

I still only see tests for the controllers, but no unit tests for the (now, 5) individual changed components.

I don't understand what kind of tests do you expect. I just added another one to check passing isDayBlocked from SingleDatePicker to SingleDatePickerInputController

Copy link
Collaborator

ljharb left a comment

To be clear: you changed DateRangePicker, so there should be tests for those changes in https://github.com/airbnb/react-dates/blob/master/test/components/DateRangePicker_spec.jsx. Also SingleDatePicker, so there should be tests in https://github.com/airbnb/react-dates/blob/master/test/components/DateRangePicker_spec.jsx.

Basically, every component should be individually unit tested, even if it's already covered by tests for a consuming component.

@mmarkelov mmarkelov requested a review from ljharb Feb 5, 2020
@ljharb
ljharb approved these changes Feb 5, 2020
@ljharb ljharb force-pushed the mmarkelov:Fix-onChange-validation branch from 64e51b2 to 0535640 Feb 5, 2020
@ljharb ljharb merged commit 0535640 into airbnb:master Feb 5, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 80.973%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.