resize-observer.test.js 797 字节
Newer Older
1
describe('api-resize-observer', () => {
雪洛's avatar
雪洛 已提交
2 3 4 5
  if (
    !process.env.uniTestPlatformInfo.startsWith('android') &&
    !process.env.uniTestPlatformInfo.startsWith('web')
  ) {
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    it('dummyTest', async () => {
      expect(1).toBe(1)
    })
    return
  }

  let page
  beforeAll(async () => {
    page = await program.reLaunch('/pages/API/resize-observer/resize-observer')
    await page.waitFor('button')
  })

  it('check_resize-observer', async () => {
    await page.waitFor(600)
    const image = await program.screenshot();
    expect(image).toSaveImageSnapshot();
  })
23 24 25 26 27 28 29

  it('check_outbox_resize', async () => {
    await page.callMethod('setOutBoxMarginLeft', '100px')
    await page.waitFor(500)
    const value = await page.data('outBoxElementOnResize')
    expect(value).toBe(false)
  })
30
})