-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Inject layout through onLayout's View #1708
Comments
We are not going to be able to help you without a repository that shows this issue. Note that this is unlikely a Jest issue but rather a testing question on how to write a test for a specific react-native component. Feel free to add more info but I'm going to close this to manage our queue. Happy to reopen if this turns out to be a Jest issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have a component that vary its rendering depending on its width. To achieve this, I use the
onLayout
property ofView
component. Hence, in my tests, I don't seem to be able to inject a mocked layout and the methodonLayout
does not seem to be called at all.Example of a snapshot test:
I'm not sure how to approach this.
Version
jest: 15.1.1
node: v5.3.0
npm: 3.3.12
OS: Windows 10
The text was updated successfully, but these errors were encountered: