Browse Source

Remove redundant button in OptionsScreen

Guy Carmeli 5 years ago
parent
commit
c3fc964266
2 changed files with 2 additions and 11 deletions
  1. 2
    2
      e2e/Options.test.js
  2. 0
    9
      playground/src/screens/OptionsScreen.js

+ 2
- 2
e2e/Options.test.js View File

77
   it('set title after setting react component', async () => {
77
   it('set title after setting react component', async () => {
78
     await elementById(TestIDs.SET_REACT_TITLE_VIEW).tap();
78
     await elementById(TestIDs.SET_REACT_TITLE_VIEW).tap();
79
     await expect(elementByLabel('Press Me')).toBeVisible();
79
     await expect(elementByLabel('Press Me')).toBeVisible();
80
-    await elementById(TestIDs.SET_TITLE).tap();
81
-    await expect(elementByLabel('Title')).toBeVisible();
80
+    await elementById(TestIDs.CHANGE_TITLE_BTN).tap();
81
+    await expect(elementByLabel('Title Changed')).toBeVisible();
82
   });
82
   });
83
 
83
 
84
   it('Popping screen with yellow box should not crash', async () => {
84
   it('Popping screen with yellow box should not crash', async () => {

+ 0
- 9
playground/src/screens/OptionsScreen.js View File

67
         <Button label='Push' testID={PUSH_BTN} onPress={this.push} />
67
         <Button label='Push' testID={PUSH_BTN} onPress={this.push} />
68
         <Button label='Hide TopBar in DefaultOptions' testID={HIDE_TOPBAR_DEFAULT_OPTIONS} onPress={this.hideTopBarInDefaultOptions} />
68
         <Button label='Hide TopBar in DefaultOptions' testID={HIDE_TOPBAR_DEFAULT_OPTIONS} onPress={this.hideTopBarInDefaultOptions} />
69
         <Button label='Set React Title View' testID={SET_REACT_TITLE_VIEW} onPress={this.setReactTitleView} />
69
         <Button label='Set React Title View' testID={SET_REACT_TITLE_VIEW} onPress={this.setReactTitleView} />
70
-        <Button label='Set Title' testID={SET_REACT_TITLE_VIEW} onPress={this.setTitle} />
71
         <Button label='Show Yellow Box' testID={SHOW_YELLOW_BOX_BTN} onPress={() => console.warn('Yellow Box')} />
70
         <Button label='Show Yellow Box' testID={SHOW_YELLOW_BOX_BTN} onPress={() => console.warn('Yellow Box')} />
72
         <Button label='StatusBar' onPress={this.statusBarScreen} />
71
         <Button label='StatusBar' onPress={this.statusBarScreen} />
73
       </Root>
72
       </Root>
121
     }
120
     }
122
   });
121
   });
123
 
122
 
124
-  setTitle = () => Navigation.mergeOptions(this, {
125
-    topBar: {
126
-      title: {
127
-        text: 'Title'
128
-      }
129
-    }
130
-  });
131
-
132
   statusBarScreen = () => Navigation.showModal(Screens.StatusBar);
123
   statusBarScreen = () => Navigation.showModal(Screens.StatusBar);
133
 }
124
 }
134
 
125