UNPKG

@applicaster/zapp-react-native-ui-components

Version:

Applicaster Zapp React Native ui components for the Quick Brick App

29 lines (22 loc) 651 B
/* eslint-disable no-global-assign */ /* eslint-disable react/prop-types */ import React from "react"; import { View, Text } from "react-native"; import { render } from "@testing-library/react-native"; import { TestId } from "../TestId"; const TestComponent = ({ name }) => ( <View> <Text>{name}</Text> </View> ); const screenId = "A1234"; describe("TestId", () => { it("renders correctly and assigns the testID to a wrapping view", () => { const wrapper = render( <TestId screenId={screenId}> <TestComponent name="dev test" /> </TestId> ); expect(wrapper.getByTestId(screenId)).toBeTruthy(); }); });