We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d5e15b commit ccad804Copy full SHA for ccad804
src/helpers/getByAPI.js
@@ -20,8 +20,10 @@ const getNodeByText = (node, text) => {
20
const isTextComponent =
21
filterNodeByType(node, Text) || filterNodeByType(node, TextInput);
22
if (isTextComponent) {
23
- const textChildren = React.Children.map(node.props.children, child =>
24
- child.toString()
+ const textChildren = React.Children.map(
+ node.props.children,
25
+ // In some cases child might be undefined
26
+ child => (child ? child.toString() : '')
27
);
28
if (textChildren) {
29
const textToTest = textChildren.join('');
0 commit comments