diff --git a/components/Lifecycle.uvue b/components/Lifecycle.uvue index e67a08c8d97061850059a23d78c4877aa2e4345f..7893b0d1b40dfd4ebb5071e378c0f7efeda68131 100644 --- a/components/Lifecycle.uvue +++ b/components/Lifecycle.uvue @@ -1,7 +1,6 @@ diff --git a/pages/app-instance/globalProperties/globalProperties.uvue b/pages/app-instance/globalProperties/globalProperties.uvue index 3b1c7b79df26b8fc5d3af3b2ad7188b58851d39d..5febc88359829324f19a1820b1e29a99e1c4739a 100644 --- a/pages/app-instance/globalProperties/globalProperties.uvue +++ b/pages/app-instance/globalProperties/globalProperties.uvue @@ -76,7 +76,7 @@ }) this.myGlobalProperties.map = {} this.globalPropertiesMap.forEach((value, key) => { - this.myGlobalProperties.map[key!] = value + this.myGlobalProperties.map[key] = value }) this.myGlobalProperties.reactiveObj = this.globalPropertiesReactiveObj this.globalPropertiesFnRes = this.globalPropertiesFn() diff --git a/pages/lifecycle/component/component.test.js b/pages/lifecycle/component/component.test.js index 6abc0a9159d4833418bab92f4727923857448a78..9208c96f8410a1f7b6b2a898b317685e21aa1097 100644 --- a/pages/lifecycle/component/component.test.js +++ b/pages/lifecycle/component/component.test.js @@ -26,24 +26,15 @@ describe('component-lifecycle', () => { lifeCycleNum = await page.callMethod('getLifeCycleNum') expect(lifeCycleNum).toBe(4) }) - it('beforeUpdate updated', async () => { - // TODO: web 端组件更新不触发 updated,待修复后调整测试例 - if (process.env.uniTestPlatformInfo.startsWith('android')) { - const component = await page.$('.component-lifecycle') - await component.setData({ - title: 'component for lifecycle test new title' - }) - lifeCycleNum = await page.callMethod('getLifeCycleNum') - expect(lifeCycleNum).toBe(6) - } + it('beforeUpdate updated', async () => { + const updateTitleBtn = await page.$('.component-lifecycle-btn') + await updateTitleBtn.tap() + lifeCycleNum = await page.callMethod('getLifeCycleNum') + expect(lifeCycleNum).toBe(6) }) it('beforeUnmount unmounted', async () => { page = await program.navigateBack() - lifeCycleNum = await page.callMethod('getLifeCycleNum') - if (process.env.uniTestPlatformInfo.startsWith('android')) { - expect(lifeCycleNum).toBe(4) - }else{ - expect(lifeCycleNum).toBe(2) - } + lifeCycleNum = await page.callMethod('getLifeCycleNum') + expect(lifeCycleNum).toBe(4) }) }) \ No newline at end of file