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

refactor: 调整 checkGetAndroidView 返回结果

上级 56db0c77
const HOME_PAGE_PATH = '/pages/tabBar/component' const HOME_PAGE_PATH = '/pages/tabBar/component'
const PAGE_PATH = '/pages/API/get-current-pages/get-current-pages?test=123' const PAGE_PATH = '/pages/API/get-current-pages/get-current-pages?test=123'
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isAndroid = platformInfo.startsWith('android')
describe('getCurrentPages', () => { describe('getCurrentPages', () => {
let page let page
...@@ -92,6 +94,6 @@ describe('getCurrentPages', () => { ...@@ -92,6 +94,6 @@ describe('getCurrentPages', () => {
}) })
it('getAndroidView', async () => { it('getAndroidView', async () => {
const res = await page.callMethod('checkGetAndroidView') const res = await page.callMethod('checkGetAndroidView')
expect(res).toBe(true) expect(res).toBe(isAndroid)
}) })
}) })
...@@ -208,12 +208,7 @@ ...@@ -208,12 +208,7 @@
checkGetAndroidView() : boolean { checkGetAndroidView() : boolean {
const page = this.getCurrentPage() const page = this.getCurrentPage()
const androidView = page.getAndroidView() const androidView = page.getAndroidView()
// #ifdef APP-ANDROID
const res = androidView != null const res = androidView != null
// #endif
// #ifndef APP-ANDROID
const res = androidView == null
// #endif
console.log('check getAndroidView', res) console.log('check getAndroidView', res)
uni.showToast(res ? { title: 'check success' } : { title: 'check fail', icon: 'error' }) uni.showToast(res ? { title: 'check success' } : { title: 'check fail', icon: 'error' })
return res return res
...@@ -262,4 +257,4 @@ ...@@ -262,4 +257,4 @@
.radio-value { .radio-value {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册