diff --git a/pages/directive/v-on/v-on-composition.uvue b/pages/directive/v-on/v-on-composition.uvue index bea027ca3f415b247a86d34fc2a427aea9d8ba71..a854782c13dd471dda6bc861e7c926b31f24cdbd 100644 --- a/pages/directive/v-on/v-on-composition.uvue +++ b/pages/directive/v-on/v-on-composition.uvue @@ -24,8 +24,13 @@ - - + + + + + + + diff --git a/pages/directive/v-on/v-on-options.uvue b/pages/directive/v-on/v-on-options.uvue index 0909514affa4202f97256f1d84ab59960208750e..82f7ab0824d09abcd0e6ff5f6350a4e31d292c1c 100644 --- a/pages/directive/v-on/v-on-options.uvue +++ b/pages/directive/v-on/v-on-options.uvue @@ -22,8 +22,13 @@ - - + + + + + + + diff --git a/pages/directive/v-on/v-on.test.js b/pages/directive/v-on/v-on.test.js index 63ab7358e8815a4ba3fd88c21ffd16026b8070ae..a0fa663b9b5d893306ad5cc3a61dda33a644d1e7 100644 --- a/pages/directive/v-on/v-on.test.js +++ b/pages/directive/v-on/v-on.test.js @@ -3,26 +3,34 @@ const COMPOSITION_PAGE_PATH = '/pages/directive/v-on/v-on-composition' describe('v-on', () => { let page - + const platformInfo = process.env.uniTestPlatformInfo.toLowerCase() + const isIos = platformInfo.startsWith('ios') + const test = async (pagePath) => { page = await program.reLaunch(pagePath) await page.waitFor('view') - + const count = await page.$('#count') expect(await count.text()).toBe('0') - + const btnList = await page.$$('.btn') for (let i = 0; i < btnList.length; i++) { await btnList[i].tap() } - - expect(await count.text()).toBe('6') + + expect(await count.text()).toBe(isIos ? '7' : '8') + + if (!isIos) { + const onceBtn = await page.$('#btn-once') + await onceBtn.tap() + expect(await count.text()).toBe('8') + } } - + it('v-on options API', async () => { await test(OPTIONS_PAGE_PATH) }) - + it('v-on composition API', async () => { await test(COMPOSITION_PAGE_PATH) })