Skip to content

Commit 92a182b

Browse files
fix remaining e2e
1 parent 3ffb4fc commit 92a182b

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

e2e/Modals.test.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ describe('modal', () => {
2626
await elementById(TestIDs.MODAL_LIFECYCLE_BTN).tap();
2727
await expect(elementByLabel('didAppear')).toBeVisible();
2828
await elementById(TestIDs.DISMISS_MODAL_BTN).tap();
29-
await expect(elementByLabel('componentWillUnmount')).toBeVisible();
29+
await waitFor(elementByLabel('componentWillUnmount')).toBeVisible().withTimeout(1000);
3030
await elementByLabel('OK').atIndex(0).tap();
31-
await expect(elementByLabel('didDisappear')).toBeVisible();
31+
await waitFor(elementByLabel('didDisappear')).toBeVisible().withTimeout(1000);
3232
await elementByLabel('OK').atIndex(0).tap();
3333
});
3434

@@ -148,11 +148,9 @@ describe('modal', () => {
148148
await elementById(TestIDs.MODAL_COMMANDS_BTN).tap();
149149
await elementById(TestIDs.MODAL_BTN).tap();
150150

151-
await expect(elementByLabel('showModal promise resolved with: UniqueStackId')).toBeVisible();
152-
await expect(
153-
elementByLabel('modalDismissed listener called with with: UniqueStackId')
154-
).toBeVisible();
155-
await expect(elementByLabel('dismissModal promise resolved with: UniqueStackId')).toBeVisible();
151+
await waitFor(elementByLabel('showModal promise resolved with: UniqueStackId')).toBeVisible().withTimeout(1000);
152+
await waitFor(elementByLabel('modalDismissed listener called with with: UniqueStackId')).toBeVisible().withTimeout(1000);
153+
await waitFor(elementByLabel('dismissModal promise resolved with: UniqueStackId')).toBeVisible().withTimeout(1000);
156154
});
157155

158156
it.e2e('should show declared modal', async () => {

playground/src/screens/OverlayBanner.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ export default class OverlayBanner extends NavigationComponent<Props> {
3131
}}
3232
pointerEvents="box-none"
3333
>
34-
<View testID={BANNER_OVERLAY} style={styles.banner}>
34+
<View style={styles.banner}>
3535
<Button
36+
testID={BANNER_OVERLAY}
3637
// @ts-ignore
3738
size={'small'}
3839
style={styles.text}

playground/src/screens/StackCommandsScreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ export default class StackCommandsScreen extends NavigationComponent<NavigationP
4747
this.setState({
4848
pushPromiseResult: `push promise resolved with: ${pushId}`,
4949
});
50-
return Navigation.pop('ChildId');
50+
return 'ChildId';
5151
})
52+
.then((popId) => new Promise<string>((resolve) => setTimeout(() => resolve(popId), 500)))
53+
.then((popId) => Navigation.pop(popId))
5254
.then((popId) => {
5355
this.setState({
5456
popPromiseResult: `pop promise resolved with: ${popId}`,

0 commit comments

Comments
 (0)