From 467abdea46402393e6514dc65ff7889a4e49a10e Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 20 Jul 2023 13:23:08 +0800 Subject: [PATCH] feat: getApp --- App.vue | 6 +++++ pages/API/get-app/get-app.test.js | 7 ++--- pages/API/get-app/get-app.uvue | 44 ++++++++++++++++++------------- pages/tabBar/API.uvue | 1 - 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/App.vue b/App.vue index 48324fef..be0d8691 100644 --- a/App.vue +++ b/App.vue @@ -35,6 +35,12 @@ export default { console.log('App LastPageBackPress') return null }, + methods: { + increasetLifeCycleNum() { + setLifeCycleNum(state.lifeCycleNum + 100) + console.log('App increasetLifeCycleNum') + } + } } diff --git a/pages/API/get-app/get-app.test.js b/pages/API/get-app/get-app.test.js index b6e9da81..b934c907 100644 --- a/pages/API/get-app/get-app.test.js +++ b/pages/API/get-app/get-app.test.js @@ -4,8 +4,9 @@ describe('getApp', () => { it('getApp', async () => { const page = await program.navigateTo(PAGE_PATH) await page.waitFor(1000) - await page.callMethod('_getApp') - const data = await page.data() - expect(data.checked).toBe(true) + const oldData = await page.data() + await page.callMethod('_increasetLifeCycleNum') + const newData = await page.data() + expect(newData.lifeCycleNum - oldData.lifeCycleNum).toBe(100) }) }) diff --git a/pages/API/get-app/get-app.uvue b/pages/API/get-app/get-app.uvue index f7bd41fa..580da9f5 100644 --- a/pages/API/get-app/get-app.uvue +++ b/pages/API/get-app/get-app.uvue @@ -1,21 +1,29 @@ - diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index f45c66eb..297d3b90 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -51,7 +51,6 @@ { name: "getApp", url: "get-app", - enable: false }, { name: "getCurrentPages", -- GitLab