about summary refs log tree commit diff
path: root/__e2e__/tests/shell.test.ts
blob: 5cfd4277feba9239dde84c697f786b36664b158a (plain) (blame)
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
/* eslint-env detox/detox */

import {openApp, login, createServer} from '../util'

describe('Shell', () => {
  let service: string
  beforeAll(async () => {
    service = await createServer('?users')
    await openApp({permissions: {notifications: 'YES'}})
  })

  it('Login', async () => {
    await login(service, 'alice', 'hunter2')
    await element(by.id('homeScreenFeedTabs-Following')).tap()
  })

  it('Can swipe the shelf open', async () => {
    await element(by.id('homeScreen')).swipe('right', 'fast', 0.75)
    await expect(element(by.id('drawer'))).toBeVisible()
    await element(by.id('drawer')).swipe('left', 'fast', 0.75)
    await expect(element(by.id('drawer'))).not.toBeVisible()
  })

  it('Can open the shelf by pressing the header avi', async () => {
    await element(by.id('viewHeaderDrawerBtn')).tap()
    await expect(element(by.id('drawer'))).toBeVisible()
  })

  it('Can navigate using the shelf', async () => {
    await element(by.id('menuItemButton-Notifications')).tap()
    await expect(element(by.id('drawer'))).not.toBeVisible()
    await expect(element(by.id('notificationsScreen'))).toBeVisible()
  })
})