use-attrs.test.js 663 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
const PAGE_PATH = '/pages/composition-api/basic/use-attrs/use-attrs'

describe('useAttrs', () => {
  if (process.env.uniTestPlatformInfo.startsWith('android')) {
    let page = null
    beforeAll(async () => {
      page = await program.reLaunch(PAGE_PATH)
      await page.waitFor('view')
    })
    it('basic', async () => {
      const attrsClass = await page.$('#attrs-class')
      expect(await attrsClass.text()).toBe('attrs.class: foo')

      const attrsMsg = await page.$('#attrs-msg')
      expect(await attrsMsg.text()).toBe('attrs.msg: msg')
    })
  } else {
    it('other platform', () => {
      expect(1).toBe(1)
    })
  }
})