diff --git a/components/Lifecycle.uvue b/components/Lifecycle.uvue index 7893b0d1b40dfd4ebb5071e378c0f7efeda68131..c0a7593a1bba1420909ed39e722ae2bd70b9a8cd 100644 --- a/components/Lifecycle.uvue +++ b/components/Lifecycle.uvue @@ -1,9 +1,9 @@ - \ No newline at end of file diff --git a/pages/composition-api/basic/use-slots/use-slots.test.js b/pages/composition-api/basic/use-slots/use-slots.test.js new file mode 100644 index 0000000000000000000000000000000000000000..d33a10d5d3acef34e175998749b8027feefea942 --- /dev/null +++ b/pages/composition-api/basic/use-slots/use-slots.test.js @@ -0,0 +1,33 @@ +const PAGE_PATH = '/pages/composition-api/basic/use-slots/use-slots' + +describe('useSlots', () => { + 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 slotHeader = await page.$('#slot-header') + expect(await slotHeader.text()).toBe('header slot num: 0') + + const slotContent = await page.$('#slot-default') + expect(await slotContent.text()).toBe('default slot msg: default msg') + + const slotFooter = await page.$('#slot-footer') + expect(await slotFooter.text()).toBe('footer slot arr: ["a","b","c"]') + + const checkUseSlotsRes = await page.$('#check-use-slots-res') + expect(await checkUseSlotsRes.text()).toBe('check useSlots result: false') + + const checkUseSlotsBtn = await page.$('#check-use-slots-btn') + await checkUseSlotsBtn.tap() + + expect(await checkUseSlotsRes.text()).toBe('check useSlots result: true') + }) + } else { + it('other platform', () => { + expect(1).toBe(1) + }) + } +}) \ No newline at end of file diff --git a/pages/composition-api/basic/use-slots/use-slots.uvue b/pages/composition-api/basic/use-slots/use-slots.uvue index 05f929c2605e69fd13461acbe5b6ef6c8c0b3642..68a42d9e2b67e053b6e1a5252431789e0c663aef 100644 --- a/pages/composition-api/basic/use-slots/use-slots.uvue +++ b/pages/composition-api/basic/use-slots/use-slots.uvue @@ -1,5 +1,17 @@ - + \ No newline at end of file diff --git a/pages/tab-bar/composition-api.uvue b/pages/tab-bar/composition-api.uvue index a011d89f63afb0b4586ee16d7f07c16dea648772..4e9f5ad400be742d993f825e168f4c892df9d617 100644 --- a/pages/tab-bar/composition-api.uvue +++ b/pages/tab-bar/composition-api.uvue @@ -75,7 +75,7 @@ { name: 'useSlots', url: 'use-slots', - enable: false, + enable: true, }, { name: 'useAttrs',