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

test: 补充 chooseLocation 测试例

上级 9de6696c
describe('dialog page', () => {
if (process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') {
it('skip app-webview', () => {
expect(1).toBe(1)
})
return
}
let page;
beforeAll(async () => {
page = await program.reLaunch('/pages/API/choose-location/choose-location')
await page.waitFor('view');
});
it('dialogPage should empty', async () => {
await page.callMethod('chooseLocation')
await page.waitFor(1000)
const dialogPagesNum = await page.data('dialogPagesNum')
expect(dialogPagesNum).toBe(0)
})
})
......@@ -35,7 +35,8 @@
latitude: [],
longitude: []
} as Location,
locationAddress: ''
locationAddress: '',
dialogPagesNum: -1
}
},
methods: {
......@@ -48,6 +49,12 @@
this.locationAddress = res.address
}
})
setTimeout(() => {
const pages = getCurrentPages()
const page = pages[pages.length - 1]
const dialogPages = page.getDialogPages()
this.dialogPagesNum = dialogPages.length
}, 500)
},
formatLocation: function(longitude:number, latitude:number):Location {
const longitudeArr = longitude.toString().split('.')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册