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 }}
Repository navigation
testing-library can't find i18next Trans texts #964
Hi @davydspotnana , this issue is currently being adressed (see #937 for more information). You can refer to this comment #937 (comment) for a workaround by mocking the trans component. Hope this helps !
@retyui The root cause is the same in both issues. RNTL can only detect text directly inside <Text> components. If you have any intermediate component (even if it doesn't appear in the renderer) RNTL will be confused and won't be able to match it.
We agree that mocking is not a long term solution, we're still trying to find a real fix, there's some progress in #967 but it's a non trivial issue.
Activity
pierrezimmermannbam commentedon May 1, 2022
Hi @davydspotnana , this issue is currently being adressed (see #937 for more information). You can refer to this comment #937 (comment) for a workaround by mocking the trans component. Hope this helps !
AugustinLF commentedon May 3, 2022
Thanks the help @pierrezimmermannbam, will mark as duplicate.
retyui commentedon May 4, 2022
@pierrezimmermannbam I am an author of two these issue ) I don think that this is duplicate (@AugustinLF please reopen it)
I don't want to mock a
Transcomponent because it affect testingWith a mock I can't:
AugustinLF commentedon May 4, 2022
@retyui The root cause is the same in both issues. RNTL can only detect text directly inside
<Text>components. If you have any intermediate component (even if it doesn't appear in the renderer) RNTL will be confused and won't be able to match it.We agree that mocking is not a long term solution, we're still trying to find a real fix, there's some progress in #967 but it's a non trivial issue.