canvas.test.js 573 字节
Newer Older
1 2
let page

3 4 5 6
beforeAll(async () => {
  if (!process.env.uniTestPlatformInfo.toLowerCase().startsWith('web')) {
    return
  }
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  page = await program.reLaunch('/pages/component/canvas/canvas')
  await page.waitFor(2000)
})

describe('Canvas.uvue', () => {
  it('toBlob', async () => {
    if (process.env.uniTestPlatformInfo.toLowerCase().startsWith('web')) {
      const {
        testToBlobResult,
        testToDataURLResult
      } = await page.data()

      expect(testToBlobResult).toBe(true)
      expect(testToDataURLResult).toBe(true)
    }
  })
})