withDirectives.test.js 650 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
const OPTIONS_PAGE_PATH = '/pages/render-function/withDirectives/withDirectives-options'
const COMPOSITION_PAGE_PATH = '/pages/render-function/withDirectives/withDirectives-composition'

describe('withDirectives', () => {
  let page = null
  const test = async (pagePath) => {
    page = await program.reLaunch(pagePath)
    await page.waitFor(1000)

    const image = await program.screenshot();
    expect(image).toSaveImageSnapshot();
  }

  it('withDirectives options API', async () => {
    await test(OPTIONS_PAGE_PATH)
  })

  it('withDirectives composition API', async () => {
    await test(COMPOSITION_PAGE_PATH)
  })
})