react-native-testing-library icon indicating copy to clipboard operation
react-native-testing-library copied to clipboard

Disabled button is press-able when rendered with wrapper option

Open etaiklein opened this issue 3 years ago • 0 comments

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

Screen Shot 2022-05-19 at 6 04 51 PM

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

etaiklein avatar May 19 '22 22:05 etaiklein