You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
this._button is a ref to TouchableOpacity component.
What you did:
Upgraded existing project from RN 0.61.5, where I had this reported issue, to 0.62.2.
With the upgrade, however, it seems like the mock-native-methods are no longer accessible because on close inspectionthis._button.measure === null returns true on tests. This is also true for the other native methods.
What happened:
The measure function is not available, therefore not being called.
Reproduction:
I'll try to update the issue with a repo that reproduces the issue.
Problem description:
The measure method, along with all other native methods mentioned in RN docs should be available on most of the default components provided by React Native.
Suggested solution:
Attempted to look into the @testing-library/react-native preset code, but could not spend too much time as to come up with a solution or improvement.
Can you help us fix this issue by submitting a pull request?
Would love to, but I have some other work priorities which may not allow me to devote the needed time to fix this. If it changes before this is resolved I'll definitely look into it.
The text was updated successfully, but these errors were encountered:
bgneu
changed the title
The Views measure + other native methods are null
View's measure + other native methods are null
Jun 19, 2020
Closing this issue, because as I debugged a bit more the issue is with the Touchable components themselves. In order to get the press fireEvent to work we have to mock TouchableOpacity (see #113 (comment)), however once mocked, attempting to get a reference to the component does not work, which then snowballs into the issue that caused me to create this ticket.
react-native
orexpo
: react-nativenative-testing-library
version: 5.0.3jest-preset
: @testing-library/react-native/jest-presetreact-native
version: 0.62.2node
version: 14.4.0Relevant code or config:
this._button
is a ref toTouchableOpacity
component.What you did:
Upgraded existing project from RN 0.61.5, where I had this reported issue, to 0.62.2.
With the upgrade, however, it seems like the mock-native-methods are no longer accessible because on close inspection
this._button.measure === null
returns true on tests. This is also true for the other native methods.What happened:
The
measure
function is not available, therefore not being called.Reproduction:
I'll try to update the issue with a repo that reproduces the issue.
Problem description:
The
measure
method, along with all other native methods mentioned in RN docs should be available on most of the default components provided by React Native.Suggested solution:
Attempted to look into the
@testing-library/react-native
preset code, but could not spend too much time as to come up with a solution or improvement.Can you help us fix this issue by submitting a pull request?
Would love to, but I have some other work priorities which may not allow me to devote the needed time to fix this. If it changes before this is resolved I'll definitely look into it.
The text was updated successfully, but these errors were encountered: