mobile: await render() in smoke test for RNTL v14 compatibility

RNTL v14 makes render() async; awaiting it is a no-op on v13, so this
works on both and unblocks the dependabot v14 bump (#508).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-06-10 03:29:07 +02:00
parent 1a65b40d18
commit 67e976f7cc
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9

View file

@ -3,8 +3,10 @@ import { render, screen } from "@testing-library/react-native";
import { Text } from "react-native";
describe("Jest + React Native Testing Library", () => {
it("renders a component", () => {
render(<Text testID="hello">Hello</Text>);
it("renders a component", async () => {
// await is a no-op on RNTL v13 but required on v14, where render()
// returns a Promise
await render(<Text testID="hello">Hello</Text>);
expect(screen.getByTestId("hello")).toBeTruthy();
expect(screen.getByText("Hello")).toBeTruthy();
});