forked from wix/react-native-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetRoot.test.js
36 lines (30 loc) · 1.37 KB
/
SetRoot.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Utils from './Utils';
import TestIDs from '../playground/src/testIDs';
const { elementById } = Utils;
describe('SetRoot', () => {
beforeEach(async () => {
await device.launchApp({ newInstance: true });
await elementById(TestIDs.NAVIGATION_TAB).tap();
await elementById(TestIDs.SET_ROOT_BTN).tap();
});
it('set root multiple times with the same componentId', async () => {
await elementById(TestIDs.SET_MULTIPLE_ROOTS_BTN).tap();
await expect(elementById(TestIDs.PUSHED_SCREEN_HEADER)).toBeVisible();
});
it('set root hides bottomTabs', async () => {
await elementById(TestIDs.SET_ROOT_HIDES_BOTTOM_TABS_BTN).tap();
await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeNotVisible();
await elementById(TestIDs.PUSH_BTN).tap();
await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeVisible();
});
it('set root with deep stack hides bottomTabs', async () => {
await elementById(TestIDs.SET_ROOT_WITH_STACK_HIDES_BOTTOM_TABS_BTN).tap();
await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeNotVisible();
await elementById(TestIDs.POP_BTN).tap();
await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeVisible();
});
it('set root without stack hides bottomTabs', async () => {
await elementById(TestIDs.SET_ROOT_WITHOUT_STACK_HIDES_BOTTOM_TABS_BTN).tap();
await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeNotVisible();
});
});