-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
When running the test, I receive this error specified by jest.setTimeout.Timeout - Async callback was not invoked within the 30000 ms timeout specified by jest.setTimeout.Error:
The first one works.
it('takes a screenshot of the initial screen', async () => {
const screen = await takeScreenshot('initial');
expect(screen).toMatchBaseline();
});
The second one doesn't work.
it('show loading, then takes a screenshot', async () => {
await press('showLoading'); // if I remove this line, it is working.
const screen = await takeScreenshot('show-loading');
expect(screen).toMatchBaseline();
});
My opinion is that when calling the press function, it doesn't find the testID.
My code:
return (
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
{loading && <ActivityIndicator />}
<Pressable testID="showLoading" onPress={() => setLoading(true)}>
<Text>Show Loading</Text>
</Pressable>
</SafeAreaView>
);
My repo link is here: https://github.com/burhanyilmaz/reactNativeOwl
my logs exist on there.
Metadata
Metadata
Assignees
Labels
No labels