Browse Source

multiple children stack e2e test

yogevbd 6 years ago
parent
commit
69ec201684
3 changed files with 10 additions and 1 deletions
  1. 8
    0
      e2e/ScreenStack.test.js
  2. 1
    1
      playground/src/screens/ModalScreen.js
  3. 1
    0
      playground/src/testIDs.js

+ 8
- 0
e2e/ScreenStack.test.js View File

@@ -85,4 +85,12 @@ describe('screen stack', () => {
85 85
     await elementById(testIDs.HIDE_TOP_BAR_BUTTON).tap();
86 86
     await expect(elementById(testIDs.TOP_BAR_ELEMENT)).toBeVisible();
87 87
   });
88
+
89
+  it('push stack with multiple children', async () => {
90
+    await elementById(testIDs.SHOW_MODAL_BUTTON).tap();
91
+    await elementById(testIDs.MODAL_WITH_STACK_BUTTON).tap();
92
+    await expect(elementByLabel('Screen 2')).toBeVisible();
93
+    await Utils.tapBackIos();
94
+    await expect(elementByLabel('Screen 1')).toBeVisible();
95
+  });
88 96
 });

+ 1
- 1
playground/src/screens/ModalScreen.js View File

@@ -38,7 +38,7 @@ class ModalScreen extends Component {
38 38
         <Button title="Dismiss Unknown Modal" testID={testIDs.DISMISS_UNKNOWN_MODAL_BUTTON} onPress={this.onClickDismissUnknownModal} />
39 39
         <Button title="Dismiss All Modals" testID={testIDs.DISMISS_ALL_MODALS_BUTTON} onPress={this.onClickDismissAllModals} />
40 40
         <Button title="Push screen" testID={testIDs.PUSH_BUTTON} onPress={this.onClickPushScreen} />
41
-        <Button title="Show Modal With Stack" testID={testIDs.PUSH_BUTTON} onPress={this.onShowModalWithDeepStack} />
41
+        <Button title="Show Modal With Stack" testID={testIDs.MODAL_WITH_STACK_BUTTON} onPress={this.onShowModalWithDeepStack} />
42 42
         {this.getPreviousModalId() ? (<Button title="Dismiss Previous Modal" testID={testIDs.DISMISS_PREVIOUS_MODAL_BUTTON} onPress={this.onClickDismissPreviousModal} />) : undefined}
43 43
         {this.props.previousModalIds ? (<Button title="Dismiss ALL Previous Modals" testID={testIDs.DISMISS_ALL_PREVIOUS_MODAL_BUTTON} onPress={this.onClickDismissAllPreviousModals} />) : undefined}
44 44
         {this.props.previousModalIds ? (<Button title="Dismiss First In Stack" testID={testIDs.DISMISS_FIRST_MODAL_BUTTON} onPress={this.onClickDismissFirstInStack} />) : undefined}

+ 1
- 0
playground/src/testIDs.js View File

@@ -49,6 +49,7 @@ module.exports = {
49 49
   SHOW_OVERLAY_BUTTON: `SHOW_OVERLAY_BUTTON`,
50 50
   SHOW_TOUCH_THROUGH_OVERLAY_BUTTON: `SHOW_TOUCH_THROUGH_OVERLAY_BUTTON`,
51 51
   OK_BUTTON: `OK_BUTTON`,
52
+  MODAL_WITH_STACK_BUTTON: `MODAL_WITH_STACK_BUTTON`,
52 53
 
53 54
   // Elements
54 55
   SCROLLVIEW_ELEMENT: `SCROLLVIEW_ELEMENT`,