define-slots.test.js 655 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3
const PAGE_PATH = '/pages/composition-api/basic/define-slots/define-slots'

describe('defineSlots', () => {
4 5 6 7 8 9 10 11 12 13 14 15 16
  let page = null
  beforeAll(async () => {
    page = await program.reLaunch(PAGE_PATH)
    await page.waitFor('view')
  })
  it('basic', async () => {
    const slotHeader = await page.$('#slot-header')
    expect(await slotHeader.text()).toBe('header slot msg: foo msg')

    const slotContent = await page.$('#slot-default')
    expect(await slotContent.text()).toBe('default slot num: 0')

    const slotFooter = await page.$('#slot-footer')
DCloud-WZF's avatar
DCloud-WZF 已提交
17
    expect(await slotFooter.text()).toBe('footer slot arr: ["a","b","c"]')
18
  })
DCloud-WZF's avatar
DCloud-WZF 已提交
19
})