Skip to content

Commit 01249f6

Browse files
authored
Revert "fix: getAllBy* methods return more elements than expected (#57)" (#60)
This reverts commit d6d225d.
1 parent dafad90 commit 01249f6

File tree

4 files changed

+139
-70
lines changed

4 files changed

+139
-70
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"jest": "^23.6.0",
2525
"metro-react-native-babel-preset": "^0.49.0",
2626
"react": "16.6.1",
27-
"react-native": "^0.57.5",
27+
"react-native": "^0.57.3",
2828
"react-test-renderer": "16.6.1",
2929
"release-it": "^7.6.2",
3030
"strip-ansi": "^5.0.0",

src/__tests__/__snapshots__/shallow.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ exports[`shallow rendering React Test Instance 1`] = `
1313
`;
1414

1515
exports[`shallow rendering React elements 1`] = `
16-
<View>
17-
<Text
16+
<Component>
17+
<Component
1818
testID="text-button"
1919
>
2020
Press me
21-
</Text>
22-
</View>
21+
</Component>
22+
</Component>
2323
`;

src/helpers/getByAPI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ErrorWithStack from './errorWithStack';
55
const getNodeByName = (node, name) =>
66
node.type.name === name ||
77
node.type.displayName === name ||
8-
(typeof name === 'function' && node.type === name);
8+
node.type === name;
99

1010
const getNodeByText = (node, text) =>
1111
(getNodeByName(node, 'Text') || getNodeByName(node, 'TextInput')) &&

0 commit comments

Comments
 (0)