Skip to content

Conversation

@mmarkelov
Copy link
Contributor

Fix #1915

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

@ljharb ljharb added the semver-minor: new stuff Any feature or API addition. label Feb 4, 2020
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.

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 February 4, 2020 12:06
@ljharb
Copy link
Member

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
Copy link
Contributor Author

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
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.

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 February 5, 2020 10:48
@ljharb ljharb force-pushed the Fix-onChange-validation branch from 64e51b2 to 0535640 Compare February 5, 2020 17:59
@ljharb ljharb merged commit 0535640 into react-dates:master Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor: new stuff Any feature or API addition.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blocked date typed into a DatePicker is recognized as a valid date (calendar is losing focus and date is selected))

2 participants