-
Notifications
You must be signed in to change notification settings - Fork 272
V7 getByText no longer find translation string #553
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
Comments
This should definitely pass. cc @AugustinLF working on this field |
Yep, there's some changes incoming to the way we find text in the rendered component. This use case should be covered, I also feel that it was already covered. Would you mind having a look at #554 and see if it works for your use case? |
@AugustinLF , thanks for the response. I will try today and report back |
Experiencing this as well with react-intl |
We are possibly experiencing this as well. We are using |
Also experiencing this with Lingui, I've set up a reproduction of the issue. Calling
But it still fails to be found.
|
I'v found a workaround for react-intl.
So what fixes the issue for me and allowing me to use getByText is turning this to:
This forces the FormattedMessage component to use Text as a wrapper instead of React.Fragment which is the default. |
@nirbenya thanks for sharing! This makes sense, because RNTL uses native |
We are using expect(queryAllByText(/look for me/i).length).toBeGreaterThanOrEqual(1); |
The issue is also related to #937. We're discussing potential solutions there and will therefore close this issue meanwhile. If you disagree with me, please let me know :) |
Describe the bug
In our codebase, we implement translation with jsLingui and have code like this:
Trans
would render a string.Previously,
getByText("There was a problem fetching data.")
would return a match and it no longer doesExpected behavior
getByText("There was a problem fetching data.")
should return a matchSteps to Reproduce
See above
Screenshots
debug() would render
Versions
The text was updated successfully, but these errors were encountered: