about summary refs log tree commit diff
path: root/__e2e__/tests/self-labeling.test.ts
blob: 68678688d6f49788c215d6ccdd2239d2c42a2469 (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
/* eslint-env detox/detox */

import {openApp, loginAsAlice, createServer, sleep} from '../util'

describe('Self-labeling', () => {
  beforeAll(async () => {
    await createServer('?users')
    await openApp({
      permissions: {notifications: 'YES', medialibrary: 'YES', photos: 'YES'},
    })
  })

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

  it('Post an image with the porn label', async () => {
    await element(by.id('composeFAB')).tap()
    await element(by.id('composerTextInput')).typeText('Post with an image')
    await element(by.id('openGalleryBtn')).tap()
    await sleep(3e3)
    await element(by.id('labelsBtn')).tap()
    await element(by.id('pornLabelBtn')).tap()
    await element(by.id('confirmBtn')).tap()
    await element(by.id('composerPublishBtn')).tap()
    await expect(element(by.id('composeFAB'))).toBeVisible()
    const posts = by.id('feedItem-by-alice.test')
    await expect(
      element(by.id('contentHider-embed').withAncestor(posts)).atIndex(0),
    ).toExist()
  })
})