I am learning testing react native apps with jest and react testing library. I could not find how to check if ActivityIndicator is being shown. How do I query for that? Is there an accessibility role? I managed to query by accessibilityHint which I gave like this:
const { queryByAccessibilityHint } = render(
<View>
<ActivityIndicator accessibilityHint='loading' />
</View>
)
await waitFor( () => {
expect(queryByAccessibilityHint('loading')).not.toBeNull()
})
But is it OK? And how about showing an ActivityIndicator in a FlatList when using a RefreshControl? I could not manage to set the accessibility role.