Revert "fix: getAllBy* methods return more elements than expected (#57)" (#60)

This reverts commit d6d225d825.
This commit is contained in:
Michał Pierzchała
2018-11-14 14:07:43 +01:00
committed by GitHub
parent dafad90bb6
commit 01249f6609
4 changed files with 138 additions and 69 deletions
@@ -13,11 +13,11 @@ exports[`shallow rendering React Test Instance 1`] = `
`;
exports[`shallow rendering React elements 1`] = `
<View>
<Text
<Component>
<Component
testID="text-button"
>
Press me
</Text>
</View>
</Component>
</Component>
`;
+1 -1
View File
@@ -5,7 +5,7 @@ import ErrorWithStack from './errorWithStack';
const getNodeByName = (node, name) =>
node.type.name === name ||
node.type.displayName === name ||
(typeof name === 'function' && node.type === name);
node.type === name;
const getNodeByText = (node, text) =>
(getNodeByName(node, 'Text') || getNodeByName(node, 'TextInput')) &&