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

test: 补充 chooseLocation 测试例

上级 ec0f4165
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)
})
})
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
latitude: [], latitude: [],
longitude: [] longitude: []
} as Location, } as Location,
locationAddress: '' locationAddress: '',
dialogPagesNum: -1
} }
}, },
methods: { methods: {
...@@ -52,6 +53,12 @@ ...@@ -52,6 +53,12 @@
this.locationAddress = res.address 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 { formatLocation: function(longitude:number, latitude:number):Location {
const longitudeArr = longitude.toString().split('.') const longitudeArr = longitude.toString().split('.')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册