@@ -37,6 +37,78 @@ describe('maplibregl MapExtend', () => {
37
37
center : [ 116.4 , 39.79 ] ,
38
38
zoom : 3
39
39
} ) ;
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
+ } ) ;
40
112
} ) ;
41
113
afterAll ( ( ) => {
42
114
window . document . body . removeChild ( testDiv ) ;
0 commit comments