Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
xilanhuaweidapao committed Oct 9, 2024
1 parent 486267e commit f7979ca
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/maplibregl/mapping/WebMapV2Spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,8 @@ describe('maplibregl_WebMapV2', () => {
return Promise.resolve(new Response(layerData_CSV));
} else if (url.indexOf('web/datas/144371940/content.json') > -1) {
return Promise.resolve(new Response(JSON.stringify(layerData_geojson['LINE_GEOJSON'])));
} else if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
Expand Down Expand Up @@ -2076,6 +2078,8 @@ describe('maplibregl_WebMapV2', () => {
return Promise.resolve(new Response(layerData_CSV));
} else if (url.indexOf('web/datas/144371940/content.json') > -1) {
return Promise.resolve(new Response(JSON.stringify(layerData_geojson['LINE_GEOJSON'])));
} else if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
const map = {
Expand Down Expand Up @@ -2169,6 +2173,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('ChinaqxAlberts_4548%40fl-new/style.json') > -1) {
return Promise.resolve(new Response(styleJson));
}
if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
const callback = function () {
Expand Down Expand Up @@ -2199,6 +2206,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('ChinaqxAlberts_4548%40fl-new/style.json') > -1) {
return Promise.resolve(new Response(styleJson));
}
if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
const callback = function (data) {
Expand Down Expand Up @@ -2237,6 +2247,8 @@ describe('maplibregl_WebMapV2', () => {
return Promise.resolve(new Response(layerData_CSV));
} else if (url.indexOf('web/datas/144371940/content.json') > -1) {
return Promise.resolve(new Response(JSON.stringify(layerData_geojson['LINE_GEOJSON'])));
} else if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
Expand Down Expand Up @@ -2706,6 +2718,12 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('106007908/map.json') > -1) {
return Promise.resolve(new Response(JSON.stringify(qixiangLayer2)));
}
if (url.indexOf('106007908/map.json') > -1) {
return Promise.resolve(new Response(JSON.stringify(qixiangLayer2)));
}
if (url.indexOf('T202007210600.json') > -1 || url.indexOf('T202007210700.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(
'',
Expand Down Expand Up @@ -2766,6 +2784,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('/map4548%40fl-new.json') > -1) {
return Promise.resolve(
new Response(JSON.stringify({
prjCoordSys: {
epsgCode: '3857'
},
bounds: {
top: 5178663.047080055,
left: 328182.9260637246,
Expand Down Expand Up @@ -2819,6 +2840,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('ChinaqxAlberts_4548%40fl-new/style.json') > -1) {
return Promise.resolve(new Response(styleJson));
}
if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
const callback = function () {
Expand Down Expand Up @@ -2862,6 +2886,9 @@ describe('maplibregl_WebMapV2', () => {
});
return Promise.resolve(new Response(JSON.stringify(nextStyleJSON)));
}
if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
const callback = function () {
Expand Down Expand Up @@ -2933,6 +2960,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('ChinaqxAlberts_4548%40fl-new/style.json') > -1) {
return Promise.resolve(new Response(styleJson));
}
if (url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(id, { ...commonOption });
const callback = function () {
Expand Down Expand Up @@ -2971,6 +3001,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('106007908/map.json') > -1) {
return Promise.resolve(new Response(JSON.stringify(tileLayerMap)));
}
if (url.indexOf('base/resources/img/baiduTileTest.png') > -1 || url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(
'',
Expand Down Expand Up @@ -3019,6 +3052,9 @@ describe('maplibregl_WebMapV2', () => {
if (url.indexOf('web/datas/1184572358/content.json') > -1) {
return Promise.resolve(new Response(layerData_CSV));
}
if (url.indexOf('China_Dark.json') > -1 || url.indexOf('China.json') > -1) {
return Promise.resolve(new Response(JSON.stringify({})));
}
});
datavizWebmap = new WebMap(
'',
Expand Down

0 comments on commit f7979ca

Please sign in to comment.