提交 edff6e16 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(component instance): 全平台支持 hasInjectionContext

上级 3e74a202
......@@ -23,10 +23,7 @@
const checkHasInjectionContextRes = ref('')
const checkHasInjectionContext = () => {
// TODO: web vue 版本低导致 hasInjectionContext 不支持, 待支持后调整
// #ifdef APP-ANDROID
checkHasInjectionContextRes.value = `${hasInjectionContext()}`
// #endif
}
checkHasInjectionContext()
</script>
\ No newline at end of file
......@@ -23,14 +23,12 @@ describe('组合式 API provide', () => {
const fn = await page.$('.fn')
expect(await fn.text()).toBe('fn: hello')
if (process.env.uniTestPlatformInfo.startsWith('android')) {
const hasInjectionContext = await page.$('.has-injection-context')
expect(await hasInjectionContext.text()).toBe('hasInjectionContext: true')
const hasInjectionContext = await page.$('.has-injection-context')
expect(await hasInjectionContext.text()).toBe('hasInjectionContext: true')
const checkHasInjectionContextBtn = await page.$('.check-has-injection-context-btn')
await checkHasInjectionContextBtn.tap()
const checkHasInjectionContextBtn = await page.$('.check-has-injection-context-btn')
await checkHasInjectionContextBtn.tap()
expect(await hasInjectionContext.text()).toBe('hasInjectionContext: false')
}
expect(await hasInjectionContext.text()).toBe('hasInjectionContext: false')
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册