【发布时间】:2020-08-31 04:00:23
【问题描述】:
其实不确定,应该是开玩笑的。 但是如何确保在屏幕上找到的文本是可见的? 有我的短文件,例如: (设置文字颜色和bg一样,但是通过了)
如果您想复制/粘贴,请以文本格式发送给您
export default () => (
<SafeAreaView style={ style.container }>
<Text style={ style.text }>loading..</Text>
</SafeAreaView>
)
,
test('In Loading screen, there is "loading" visible label', () => {
const { getByText } = render(
<Loading />
)
getByText(/loading/) // exact 1 (not 0, not >)
})
【问题讨论】:
标签: react-native testing jestjs accessibility react-testing-library