Przeglądaj źródła

Remove redundant button in OptionsScreen

Guy Carmeli 5 lat temu
rodzic
commit
c3fc964266
2 zmienionych plików z 2 dodań i 11 usunięć
  1. 2
    2
      e2e/Options.test.js
  2. 0
    9
      playground/src/screens/OptionsScreen.js

+ 2
- 2
e2e/Options.test.js Wyświetl plik

@@ -77,8 +77,8 @@ describe('Options', () => {
77 77
   it('set title after setting react component', async () => {
78 78
     await elementById(TestIDs.SET_REACT_TITLE_VIEW).tap();
79 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 84
   it('Popping screen with yellow box should not crash', async () => {

+ 0
- 9
playground/src/screens/OptionsScreen.js Wyświetl plik

@@ -67,7 +67,6 @@ class Options extends Component {
67 67
         <Button label='Push' testID={PUSH_BTN} onPress={this.push} />
68 68
         <Button label='Hide TopBar in DefaultOptions' testID={HIDE_TOPBAR_DEFAULT_OPTIONS} onPress={this.hideTopBarInDefaultOptions} />
69 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 70
         <Button label='Show Yellow Box' testID={SHOW_YELLOW_BOX_BTN} onPress={() => console.warn('Yellow Box')} />
72 71
         <Button label='StatusBar' onPress={this.statusBarScreen} />
73 72
       </Root>
@@ -121,14 +120,6 @@ class Options extends Component {
121 120
     }
122 121
   });
123 122
 
124
-  setTitle = () => Navigation.mergeOptions(this, {
125
-    topBar: {
126
-      title: {
127
-        text: 'Title'
128
-      }
129
-    }
130
-  });
131
-
132 123
   statusBarScreen = () => Navigation.showModal(Screens.StatusBar);
133 124
 }
134 125