Skip to content

Commit 21d38ca

Browse files
authored
Use @testing-library/react-native (#277)
* Use @testing-library/react-native * 18.3.1
1 parent 2320d6f commit 21d38ca

File tree

5 files changed

+364
-174
lines changed

5 files changed

+364
-174
lines changed

__mocks__/react-native.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ function createMockEmitter() {
3232

3333
const requireNativeComponent = (..._args: any[]) => {
3434
const React = require('react');
35-
return (props: any) => React.createElement('View', props);
35+
return (props: any) =>
36+
React.createElement('View', {
37+
...props,
38+
testID: props?.testID ?? 'accelerated-checkout-buttons',
39+
});
40+
};
41+
42+
const StyleSheet = {
43+
flatten: jest.fn(style => style),
3644
};
3745

3846
const exampleConfig = {preloading: true};
@@ -66,4 +74,5 @@ module.exports = {
6674
eventEmitter: createMockEmitter(),
6775
},
6876
},
77+
StyleSheet,
6978
};

0 commit comments

Comments
 (0)