force-update.test.js 649 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1
const PAGE_PATH = '/pages/component-instance/force-update/force-update'
DCloud-WZF's avatar
DCloud-WZF 已提交
2 3

describe('$forceUpdate', () => {
雪洛's avatar
雪洛 已提交
4 5 6 7 8 9 10 11
  let page
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH)
    await page.waitFor('view')
  })
  it('basic', async () => {
    const timeEl = await page.$('.time')
    const timeText1 = (await timeEl.text()).replace('Date.now(): ', '')
DCloud-WZF's avatar
DCloud-WZF 已提交
12

雪洛's avatar
雪洛 已提交
13 14
    const triggerForceUpdateBtn = await page.$('.trigger-force-update-btn')
    await triggerForceUpdateBtn.tap()
DCloud-WZF's avatar
DCloud-WZF 已提交
15

雪洛's avatar
雪洛 已提交
16
    const timeText2 = (await timeEl.text()).replace('Date.now(): ', '')
17
    expect(parseInt(timeText2)).toBeGreaterThan(parseInt(timeText1))
雪洛's avatar
雪洛 已提交
18
  })
DCloud-WZF's avatar
DCloud-WZF 已提交
19
})