提交 207f278d 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

update: pages/component/map/map.uvue

# Conflicts:
#	pages/component/map/map.uvue
上级 31a764c7
let page;
describe('web-map', () => {
if (!process.env.uniTestPlatformInfo.startsWith('web')) {
it('app', () => {
expect(1).toBe(1)
})
return
}
beforeAll(async () => {
page = await program.reLaunch('/pages/component/map/map')
await page.waitFor('view');
......@@ -16,6 +11,26 @@ describe('web-map', () => {
await page.callMethod('updateAutoTest',true)
});
it('handleMoveToLocation', async () => {
await page.callMethod('handleMoveToLocation')
await page.waitFor(500);
const moveToLocationRes = await page.data('jestResult')
expect(moveToLocationRes.moveToLocationMsg).toBe("moveToLocation:ok");
});
it('Check EventDetail JsonStringify', async () => {
const res = await page.data('jestResult')
console.log(res.eventDetailJsonStringify);
expect(res.eventDetailJsonStringify).not.toBe("{}");
})
if (!process.env.uniTestPlatformInfo.startsWith('web')) {
it('app', () => {
expect(1).toBe(1)
})
return
}
it('Check MapMethods', async () => {
const mapMethods = ['addControls', 'addMarkers', 'addMarkersLabel','removeMarker','addPolyline','removePolyline', 'addPolygons','removePolygon', 'addCircles','removeCircle','includePoint']
for (var i = 0; i < mapMethods.length; i++) {
......@@ -58,12 +73,7 @@ describe('web-map', () => {
expect(translateMarkerRes.translateMarkerMsg).toBe('translateMarker:ok');
});
it('handleMoveToLocation', async () => {
await page.callMethod('handleMoveToLocation')
await page.waitFor(500);
const moveToLocationRes = await page.data('jestResult')
expect(moveToLocationRes.moveToLocationMsg).toBe("moveToLocation:ok");
});
it('handleGetScale', async () => {
await page.callMethod('handleGetScale')
......@@ -73,5 +83,4 @@ describe('web-map', () => {
expect(scaleRes.scale).toBeLessThanOrEqual(18);
console.log("jestResult",await page.data())
});
});
......@@ -59,7 +59,8 @@
southwest : LocationObject,
northeast : LocationObject,
moveToLocationMsg : string,
scale : number
scale : number,
eventDetailJsonStringify: string,
}
const testMarkers :Marker[]= [{
......@@ -345,6 +346,7 @@
},
moveToLocationMsg: "",
scale: 0,
eventDetailJsonStringify: "{}"
} as TypeJestResult);
......@@ -666,6 +668,7 @@
const onregionchange = (e : UniMapRegionChangeEvent) => {
console.log('视野发生变化时触发', e.detail)
jestResult.eventDetailJsonStringify = JSON.stringify(e.detail)
};
const onpoitap = (e : UniMapPoiTapEvent) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册