-
-
Notifications
You must be signed in to change notification settings - Fork 44
Support DatePickerIOS #49
Comments
For historical context, the reason why this wasn't included was that the original plan was for DatePickerIOS to be taken out in the move to lean core. It looks like DatePickerIOS is still there in RN 60 though, so I'm not sure what the status of that plan is. Because of that, I'm cool with DatePickerIOS being added to the valid components if you want to submit a PR for it 👍 I don't remember the specifics of it, but |
That said, the I've mentioned this in previous issues, I don't believe the jest preset included with this library is sophisticated enough to fully replicate the confidence of React Testing Library. I still believe the community should build a much more sophisticated set of mocks for all of the react native components that can handle those imperative operations like |
Why you have to check that js api of |
My goal was to test a component that uses a date picker. In order to do that, I need to be able to control the datepicker. |
FYI, this repository is no longer responsible for this package. See the migration guide to v7.0. |
Uh oh!
There was an error while loading. Please reload this page.
react-native
orexpo
:react-native
native-testing-library
version:^4.0.7
jest-preset
:@testing-library/react-native
react-native
version:v0.60.4
node
version:v12.7.0
What you did:
I tried to write a test against a
<DatePickerIOS />
.What happened:
An unexpected error occurred:
Reproduction:
Problem description:
DatePickerIOS
callssetNativeProps
here:https://github.com/facebook/react-native/blob/9bc77fadb6b4d51690c93744c02afe40eb6e63fc/Libraries/Components/DatePicker/DatePickerIOS.ios.js#L126
I tried to pass
createNodeMock
in through theoptions
. I was hoping that by providing a mock forsetNativeProps
, that it would work.createNodeMock
was never actually used by thereact-test-renderer
, though, so my idea didn't work 😦.Suggested solution:
Maybe add a new mock for
DatePickerIOS
? 🤷♂Can you help us fix this issue by submitting a pull request?
Probably!
The text was updated successfully, but these errors were encountered: