-
Notifications
You must be signed in to change notification settings - Fork 275
Closed
Description
Hello everyone, when I try to use fireEvent.press I get this error: "No handler function found for event: "press""
const Button = ({onPress, title}) => (
<TouchableOpacity testID="button" onPress={onPress}>
<Text>{title}</Text>
</TouchableOpacity>
);
it('Button', () => {
const onPressMock = jest.fn();
const title = 'press me';
const {getByTestId} = render(<Button onPressMock={onPressMock} title={title} />);
const button = getByTestId('button');
fireEvent.press(button);
});
Screenshots
Versions
npmPackages:
@testing-library/react-native: ^7.1.0 => 7.1.0
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
react-test-renderer: 16.13.1 => 16.13.1
Metadata
Metadata
Assignees
Labels
No labels
