Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jehartzog/f234efbb6c5204ed2af81addaba312ab to your computer and use it in GitHub Desktop.
Save jehartzog/f234efbb6c5204ed2af81addaba312ab to your computer and use it in GitHub Desktop.
Patch byText query
diff --git a/node_modules/@testing-library/react-native/build/helpers/byText.js b/node_modules/@testing-library/react-native/build/helpers/byText.js
index 182bc6a..54dad43 100644
--- a/node_modules/@testing-library/react-native/build/helpers/byText.js
+++ b/node_modules/@testing-library/react-native/build/helpers/byText.js
@@ -54,7 +54,8 @@ const getNodeByText = (node, text) => {
const isTextComponent = (0, _filterNodeByType.filterNodeByType)(node, Text);
- if (isTextComponent) {
+ // https://github.com/callstack/react-native-testing-library/issues/553#issuecomment-719108211
+ if (isTextComponent || true) {
const textChildren = getChildrenAsText(node.props.children, Text);
if (textChildren) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment