Created
February 8, 2023 13:55
-
-
Save pytqqq/55ef3439f90ed70cd9a233fc276a56d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { screen, fireEvent } from "@testing-library/react-native"; | |
import { measurePerformance } from "reassure"; | |
import { AsyncComponent } from "../AsyncComponent"; | |
test("AsyncComponent", async () => { | |
const scenario = async () => { | |
const button = screen.getByText("Action"); | |
fireEvent.press(button); | |
await screen.findByText("Count: 1"); | |
fireEvent.press(button); | |
await screen.findByText("Count: 2"); | |
fireEvent.press(button); | |
fireEvent.press(button); | |
fireEvent.press(button); | |
await screen.findByText("Count: 5"); | |
}; | |
await measurePerformance(<AsyncComponent />, { scenario }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment