react-native-navigation的迁移库

SetRoot.test.js 1.1KB

12345678910111213141516171819202122232425262728293031
  1. const Utils = require('./Utils');
  2. const TestIDs = require('../playground/src/testIDs');
  3. const { elementById } = Utils;
  4. describe('SetRoot', () => {
  5. beforeEach(async () => {
  6. await device.relaunchApp();
  7. await elementById(TestIDs.NAVIGATION_TAB).tap();
  8. await elementById(TestIDs.SET_ROOT_BTN).tap();
  9. });
  10. it('set root multiple times with the same componentId', async () => {
  11. await elementById(TestIDs.SET_MULTIPLE_ROOTS_BTN).tap();
  12. await expect(elementById(TestIDs.PUSHED_SCREEN_HEADER)).toBeVisible();
  13. });
  14. it('set root hides bottomTabs', async () => {
  15. await elementById(TestIDs.SET_ROOT_HIDES_BOTTOM_TABS_BTN).tap();
  16. await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeNotVisible();
  17. await elementById(TestIDs.PUSH_BTN).tap();
  18. await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeVisible();
  19. });
  20. it('set root with stack hides bottomTabs', async () => {
  21. await elementById(TestIDs.SET_ROOT_WITH_STACK_HIDES_BOTTOM_TABS_BTN).tap();
  22. await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeNotVisible();
  23. await elementById(TestIDs.POP_BTN).tap();
  24. await expect(elementById(TestIDs.LAYOUTS_TAB)).toBeVisible();
  25. });
  26. });