Skip to content

Commit 739a910

Browse files
[fix]UT
1 parent 3c5f447 commit 739a910

2 files changed

Lines changed: 72 additions & 1 deletion

File tree

‎test/maplibregl/core/MapExtendSpec.js‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,78 @@ describe('maplibregl MapExtend', () => {
3737
center: [116.4, 39.79],
3838
zoom: 3
3939
});
40+
spyOn(FetchRequest, 'get').and.callFake((url) => {
41+
if (url.includes('map-China107')) {
42+
return Promise.resolve(
43+
new Response(
44+
JSON.stringify([
45+
{
46+
componentType: 'com.supermap.services.components.impl.MapImpl',
47+
interfaceType: 'com.supermap.services.rest.RestServlet',
48+
additions: [
49+
'China',
50+
'China_4326',
51+
'ChinaDark',
52+
'China_4490',
53+
'China_4610',
54+
'China_4214',
55+
'China1',
56+
'China_Capital_pt@China',
57+
'A'
58+
],
59+
name: 'map-China107/rest',
60+
alias: 'map-China107',
61+
serviceEncryptInfo: {
62+
encrptSpec: {
63+
keyLength: 256,
64+
attributes: 'abcd',
65+
version: '1.1',
66+
algorithm: 'AES'
67+
},
68+
updateTime: 'Tue Mar 19 09:34:18 CST 2024',
69+
encrptKeyID: 'keyIDNAME'
70+
},
71+
url: 'http://fake:8090/iserver/services/map-China107/rest',
72+
status: 'OK'
73+
},
74+
{
75+
componentType: 'com.supermap.services.components.impl.MapImpl',
76+
interfaceType: 'com.supermap.services.rest.JaxrsServletForJersey',
77+
additions: [
78+
'China',
79+
'China_4326',
80+
'ChinaDark',
81+
'China_4490',
82+
'China_4610',
83+
'China_4214',
84+
'China1',
85+
'China_Capital_pt@China',
86+
'A'
87+
],
88+
name: 'map-China107/restjsr',
89+
alias: 'map-China107',
90+
serviceEncryptInfo: {
91+
encrptSpec: {
92+
keyLength: 256,
93+
attributes: 'abcd',
94+
version: '1.1',
95+
algorithm: 'AES'
96+
},
97+
updateTime: 'Tue Mar 19 09:34:18 CST 2024',
98+
encrptKeyID: 'keyIDNAME'
99+
},
100+
url: 'http://fake:8090/iserver/services/map-China107/restjsr',
101+
status: 'OK'
102+
}
103+
])
104+
)
105+
);
106+
}
107+
108+
if (url.includes('vectorstyles')) {
109+
return Promise.resolve(new Response(JSON.stringify({})));
110+
}
111+
});
40112
});
41113
afterAll(() => {
42114
window.document.body.removeChild(testDiv);

‎test/test-main-mapboxgl.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,3 @@ import './mapboxgl/services/EditFeatureAttachmentsSpec';
8181
import './mapboxgl/mapping/WebMapSpec.js';
8282
import './mapboxgl/mapping/WebMapV3Spec.js';
8383
import './mapboxgl/mapping/InitMapSpec.js';
84-
import './mapboxgl/core/MapExtendSpec.js';

0 commit comments

Comments
 (0)