Browse Source

js - enable showModal e2e test and create dismissModal e2e test

Ran Greenberg 7 years ago
parent
commit
2d0da0d9b5
2 changed files with 19 additions and 1 deletions
  1. 8
    1
      playground/e2e/app.test.js
  2. 11
    0
      playground/src/containers/SimpleScreen.js

+ 8
- 1
playground/e2e/app.test.js View File

39
     expect(elementByLabel('React Native Navigation!')).toBeVisible();
39
     expect(elementByLabel('React Native Navigation!')).toBeVisible();
40
   });
40
   });
41
 
41
 
42
-  xit('show modal', () => {
42
+  it('show modal', () => {
43
     elementByLabel('Show Modal').tap();
43
     elementByLabel('Show Modal').tap();
44
     expect(elementByLabel('Modal screen')).toBeVisible();
44
     expect(elementByLabel('Modal screen')).toBeVisible();
45
   });
45
   });
46
+  
47
+  it('dismiss modal', () => {
48
+    elementByLabel('Show Modal').tap();
49
+    expect(elementByLabel('Modal screen')).toBeVisible();
50
+    elementByLabel('Dismiss Modal').tap();
51
+    expect(elementByLabel('React Native Navigation!')).toBeVisible();
52
+  });
46
 });
53
 });
47
 
54
 
48
 describe('reload app', () => {
55
 describe('reload app', () => {

+ 11
- 0
playground/src/containers/SimpleScreen.js View File

8
     super(props);
8
     super(props);
9
     this.onClickPop = this.onClickPop.bind(this);
9
     this.onClickPop = this.onClickPop.bind(this);
10
     this.onClickPush = this.onClickPush.bind(this);
10
     this.onClickPush = this.onClickPush.bind(this);
11
+    this.onClickShowModal = this.onClickShowModal.bind(this);
11
     this.onClickDismissModal = this.onClickDismissModal.bind(this);
12
     this.onClickDismissModal = this.onClickDismissModal.bind(this);
12
   }
13
   }
13
 
14
 
19
         {this.renderTextFromFunctionInProps()}
20
         {this.renderTextFromFunctionInProps()}
20
         <Button title="Push" onPress={this.onClickPush} />
21
         <Button title="Push" onPress={this.onClickPush} />
21
         <Button title="Pop" onPress={this.onClickPop} />
22
         <Button title="Pop" onPress={this.onClickPop} />
23
+        <Button title="Show Mddal" onPress={this.onClickPop} />
22
         <Button title="Dismiss Modal" onPress={this.onClickDismissModal} />
24
         <Button title="Dismiss Modal" onPress={this.onClickDismissModal} />
23
       </View>
25
       </View>
24
     );
26
     );
45
       }
47
       }
46
     });
48
     });
47
   }
49
   }
50
+  
51
+  onClickShowModal() {
52
+    Navigation.showModal({
53
+      name: 'navigation.playground.SimpleScreen',
54
+      passProps: {
55
+        text: 'Modal screen'
56
+      }
57
+    });
58
+  }
48
 
59
 
49
   onClickDismissModal() {
60
   onClickDismissModal() {
50
     Navigation.dismissModal(this.props.id);
61
     Navigation.dismissModal(this.props.id);