-
Notifications
You must be signed in to change notification settings - Fork 24.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
RN v0.62.0-rc.0 - Touchable[Highlight|WithoutFeedback] are rendering into a component without name under jest #27721
Comments
Interesting... I have replaced the following line
with
and now it works fine. Those lines are introduced there: 7c01172 |
@scotthovestadt is working on a fix to how Jest renders |
@scotthovestadt Am I right that PR jestjs/jest#9422 is what I am looking for? |
Ah.. no.. it is not. Sorry |
I have the same problems here, since 0.62.0 all of my tests with TouchableHighlight or TouchableOpacity-Components now fail. |
@yungsters @scotthovestadt Is there any link that we can use to track it? or even help with the fix. |
This problem has broken our I applied a temp fix by mocking
|
@halilb Thanks for your snippet, but I had to modify slightly because I have the same issue with TouchableHighlight. All tests now passing though:
|
- Related issue: facebook/react-native#27721.
Oh I've forgotten adding |
Isn't a simpler version enough:
Currently for my snapshot tests this line seems to be enough. Do you see any problem with that? |
I discovered that if you export them from // works
import { TouchableOpacity } from 'react-native-gesture-handler'
// doesn't work
import { TouchableOpacity } from 'react-native' More info here testing-library/jest-native#23 (comment) but tl;dr I suspect the issue might be related to bundling/transpiling? Seems like the Actually I think the reason behind this is the fact that I heard they want to move towards a single Looking at #21937 (comment) seems like a quick fix could be TouchableOpacity = (React.forwardRef((props, hostRef) => (...
TouchableOpacity.displayName = 'TouchableOpacity';
module.exports = TouchableOpacity |
I still have issues with firing events. My Sounds like it is related to this ticket also testing-library/native-testing-library#106 |
Oddly I have the same issue with |
Could you please tell me the exact Facebook page you’re working on? Is it
Kikiama?
…On Mon, Mar 30, 2020 at 5:21 AM devproivansurzhenko < ***@***.***> wrote:
@yungsters @scotthovestadt Is there any link that we can use to track it?
or even help with the fix.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@sebk Working for me! Thanks :) |
Came up with this, snapshots will be changed a little, but events tests will pass:
|
same issue here, this solution worked for me. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
I am on 0.62.1. Issue is still appearing. We just skipped those specs for now. I am planning to migrate my project to 0.63 during the current week. |
@devproivansurzhenko I just migrated to 0.63.2, are you not still seeing this problem? |
i am facing this issue on 0.63.4 |
This issue should be fixed here: #29531. Could someone please review it? |
I am trying to migrate from 0.59.3 to 0.62 rc0
However, I got a strange state of the app. Touchable[Highlight|WithoutFeedback] became to render without display name under jest (see snippets below).
I have the following control:
Snapshot before migration:
Snapshot after migration (no
TouchableHighlight
name):The same thing happens to TouchableWithoutFeedback. However, other controls look fine.
React Native version:
0.62 rc0
Steps To Reproduce
Not sure.
Describe what you expected to happen:
TouchableHighlight rendered to TouchableHighlight
TouchableWithoutFeedback rendered to TouchableWithoutFeedback
The text was updated successfully, but these errors were encountered: