V7 getByText no longer find translation string
See original GitHub issueDescribe the bug
In our codebase, we implement translation with jsLingui and have code like this:
// trivial implementation of Trans
const Trans = (message) => message;
const Component = () => (
<Text>
<Trans>There was a problem fetching data.</Trans>
</Text>
)
Trans
would render a string.
Previously, getByText("There was a problem fetching data.")
would return a match and it no longer does
Expected behavior
getByText("There was a problem fetching data.")
should return a match
Steps to Reproduce
See above
Screenshots
debug() would render
<Text>
There was a problem fetching data.
</Text>
Versions
npmPackages:
@testing-library/react-native: ^7.0.2 => 7.0.2
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-test-renderer: 16.11.0 => 16.11.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
reactjs - getByText doesn't find the element
When false, matches substrings and is not case-sensitive. exact has no effect on regex or function arguments. In most cases using a regex ......
Read more >gettext v0.20.0
Extract for more information on the extraction process. POT files are just template files and the translations in them do not actually contain...
Read more >ByText
This will search for all elements that have a text node with textContent matching the given TextMatch . <a href="/about"> ...
Read more >Translating localization strings
The Localize string dialog shows the content of the string in the default language, and you can fill in a translation for all...
Read more >How to Test React Components: the Complete Guide
I found this to be true as well for React testing. ... Unlike your react components, your tests are not executed in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Experiencing this as well with react-intl
We are possibly experiencing this as well. We are using
i18n-js
andexpo-localization
. We are onreact-native
v0.63.3.