react-native-testing-library
react-native-testing-library copied to clipboard
Disabled button is press-able when rendered with wrapper option
Describe the bug
Disabled calls onPress on fireEvent.press when rendered with a wrapper, but does not rendered without a wrapper.
Expected behavior
Steps to Reproduce
render(<Button {...props} disabled={true} />) does not call onPress on fireEvent.press, but
render(<Button {...props} disabled={true} />, { wrapper: ({ children }) => <>{children}</> }) calls onPress on fireEvent.press
See sandbox: https://codesandbox.io/s/laughing-butterfly-3txunr?file=/src/Button.test.js
Screenshots
Versions
npmPackages: @testing-library/react-native: 9.1.0 => 9.1.0 react: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-test-renderer: 17.0.1 => 17.0.1