This repository was archived by the owner on Jul 30, 2020. It is now read-only.
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
fireEvent.press does not work on TouchableOpacity #113
Closed
Description
react-native
orexpo
: react-nativenative-testing-library
version: 5.0.3jest-preset
: @testing-library/react-nativereact-native
: 0.62.0-rc.3node
version: v12.12.0
Relevant code or config:
import React from "react";
import { TouchableOpacity } from "react-native";
import { render, fireEvent } from "@testing-library/react-native";
it("test", async () => {
const { findByTestId } = render(
<TouchableOpacity testID="button" onPress={() => console.log("TEST")} />
);
const button = await findByTestId("button");
fireEvent.press(button);
});
What you did:
In 0.62.0-rc.3, fireEvent.press
does not seem to work at all on TouchableOpacity
. Trying on for example a Button
seems to work fine, just not TouchableOpacity
(and presumably similar components).
Reproduction:
See example code above. Running it you should see a console logged "TEST" message, in 0.62.0-rc.3, it does not appear.
Can you help us fix this issue by submitting a pull request?
Yes, though I don't know what's wrong yet.
Metadata
Metadata
Assignees
Labels
No labels