1+ class DataSource {
2+ add = jest . fn ( ) ;
3+ clear = jest . fn ( ) ;
4+ remove = jest . fn ( ) ;
5+ importDataFromUrl = jest . fn ( ) ;
6+ setOptions = jest . fn ( ) ;
7+ }
8+
19module . exports = {
210 Map : jest . fn ( ( ) => ( {
311 controls : {
412 add : jest . fn ( ) ,
5- remove : jest . fn ( )
13+ remove : jest . fn ( ) ,
614 } ,
715 events : {
816 add : jest . fn ( ( eventName , callback = ( ) => { } ) => {
9- callback ( )
17+ callback ( ) ;
1018 } ) ,
11- remove : jest . fn ( )
19+ remove : jest . fn ( ) ,
1220 } ,
1321 imageSprite : {
1422 add : jest . fn ( ) ,
15- createFromTemplate : jest . fn ( )
23+ createFromTemplate : jest . fn ( ) ,
1624 } ,
1725 sources : {
1826 add : jest . fn ( ) ,
19- remove : jest . fn ( )
27+ remove : jest . fn ( ) ,
2028 } ,
2129 layers : {
2230 add : jest . fn ( ) ,
23- remove : jest . fn ( )
31+ remove : jest . fn ( ) ,
2432 } ,
2533 popups : {
2634 getPopups : jest . fn ( ( ) => [ ] ) ,
27- remove : jest . fn ( )
35+ remove : jest . fn ( ) ,
2836 } ,
2937 markers : {
3038 add : jest . fn ( ) ,
31- remove : jest . fn ( )
39+ remove : jest . fn ( ) ,
3240 } ,
3341 setTraffic : jest . fn ( ) ,
3442 setUserInteraction : jest . fn ( ) ,
3543 setCamera : jest . fn ( ) ,
3644 setStyle : jest . fn ( ) ,
37- setServiceOptions : jest . fn ( )
45+ setServiceOptions : jest . fn ( ) ,
3846 } ) ) ,
3947
4048 HtmlMarker : jest . fn ( ( ...args ) => ( {
@@ -45,101 +53,101 @@ module.exports = {
4553 isOpen : jest . fn ( ( ) => true ) ,
4654 open : jest . fn ( ( ) => false ) ,
4755 togglePopup : jest . fn ( ) ,
48- close : jest . fn ( )
49- }
50- } ) )
56+ close : jest . fn ( ) ,
57+ } ,
58+ } ) ) ,
5159 } ) ) ,
5260 data : {
5361 LineString : jest . fn ( ( ) => ( { } ) ) ,
54- Position : jest . fn ( ( ) => ( { } ) )
62+ Position : jest . fn ( ( ) => ( { } ) ) ,
5563 } ,
5664 Pixel : jest . fn ( ( ) => ( {
57- getHeading : jest . fn ( ( ) => ' Heading' )
65+ getHeading : jest . fn ( ( ) => " Heading" ) ,
5866 } ) ) ,
5967 Popup : jest . fn ( ( ) => ( {
6068 setOptions : jest . fn ( ) ,
6169 isOpen : jest . fn ( ( ) => false ) ,
6270 open : jest . fn ( ) ,
63- close : jest . fn ( )
71+ close : jest . fn ( ) ,
6472 } ) ) ,
6573 control : {
66- CompassControl : jest . fn ( ( ) => ( { compassOption : 'option' } ) ) ,
67- PitchControl : jest . fn ( ( ) => ( { pitchOption : 'option' } ) ) ,
68- StyleControl : jest . fn ( ( ) => ( { styleOption : 'option' } ) ) ,
69- ZoomControl : jest . fn ( ( ) => ( { zoomOption : 'option' } ) )
74+ CompassControl : jest . fn ( ( ) => ( { compassOption : "option" } ) ) ,
75+ PitchControl : jest . fn ( ( ) => ( { pitchOption : "option" } ) ) ,
76+ StyleControl : jest . fn ( ( ) => ( { styleOption : "option" } ) ) ,
77+ ZoomControl : jest . fn ( ( ) => ( { zoomOption : "option" } ) ) ,
78+ TrafficControl : jest . fn ( ( ) => ( { trafficOption : "option" } ) ) ,
79+ TrafficLegendControl : jest . fn ( ( ) => ( { trafficLegendOption : "option" } ) ) ,
7080 } ,
7181 layer : {
72- ImageLayer : jest . fn ( ( options , id ) => ( { layer : ' ImageLayer' , options, id } ) ) ,
73- TileLayer : jest . fn ( ( options , id ) => ( { layer : ' TileLayer' , options, id } ) ) ,
82+ ImageLayer : jest . fn ( ( options , id ) => ( { layer : " ImageLayer" , options, id } ) ) ,
83+ TileLayer : jest . fn ( ( options , id ) => ( { layer : " TileLayer" , options, id } ) ) ,
7484 SymbolLayer : jest . fn ( ( options , id , datasourceRef ) => ( {
75- layer : ' SymbolLayer' ,
85+ layer : " SymbolLayer" ,
7686 options,
7787 id,
7888 datasourceRef,
7989 setOptions : jest . fn ( ) ,
80- getId : jest . fn ( ( ) => id )
90+ getId : jest . fn ( ( ) => id ) ,
8191 } ) ) ,
8292 HeatMapLayer : jest . fn ( ( options , id , datasourceRef ) => ( {
83- layer : ' HeatLayer' ,
93+ layer : " HeatLayer" ,
8494 options,
8595 id,
86- datasourceRef
96+ datasourceRef,
8797 } ) ) ,
8898 LineLayer : jest . fn ( ( options , id , datasourceRef ) => ( {
89- layer : ' LineLayer' ,
99+ layer : " LineLayer" ,
90100 options,
91101 id,
92- datasourceRef
102+ datasourceRef,
93103 } ) ) ,
94104 PolygonExtrusionLayer : jest . fn ( ( options , id , datasourceRef ) => ( {
95- layer : ' PolygonExtrusionLayer' ,
105+ layer : " PolygonExtrusionLayer" ,
96106 options,
97107 id,
98- datasourceRef
108+ datasourceRef,
99109 } ) ) ,
100110 PolygonLayer : jest . fn ( ( options , id , datasourceRef ) => ( {
101- layer : ' PolygonLayer' ,
111+ layer : " PolygonLayer" ,
102112 options,
103113 id,
104- datasourceRef
114+ datasourceRef,
105115 } ) ) ,
106116 BubbleLayer : jest . fn ( ( options , id , datasourceRef ) => ( {
107- layer : ' BubbleLayer' ,
117+ layer : " BubbleLayer" ,
108118 options,
109119 id,
110- datasourceRef
111- } ) )
120+ datasourceRef,
121+ } ) ) ,
112122 } ,
113123 source : {
114- DataSource : jest . fn ( ( ) => ( {
115- add : jest . fn ( ) ,
116- clear : jest . fn ( ) ,
117- remove : jest . fn ( ) ,
118- importDataFromUrl : jest . fn ( ) ,
119- setOptions : jest . fn ( )
120- } ) )
124+ DataSource,
125+ VectorTileSource : jest . fn ( ( id , options ) => ( {
126+ getId : jest . fn ( ( ) => id ) ,
127+ getOptions : jest . fn ( ( ) => options ) ,
128+ } ) ) ,
121129 } ,
122130 Shape : jest . fn ( ( ) => ( {
123131 setCoordinates : jest . fn ( ) ,
124- setProperties : jest . fn ( )
132+ setProperties : jest . fn ( ) ,
125133 } ) ) ,
126134 data : {
127135 Position : jest . fn ( ( ...args ) => args ) ,
128136 BoundingBox : jest . fn ( ( ...args ) => args ) ,
129- Point : jest . fn ( coords => ( { coords, type : ' Point' } ) ) ,
130- MultiPoint : jest . fn ( ( coords , bbox ) => ( { coords, bbox, type : ' MultiPoint' } ) ) ,
131- LineString : jest . fn ( ( coords , bbox ) => ( { coords, bbox, type : ' LineString' } ) ) ,
137+ Point : jest . fn ( ( coords ) => ( { coords, type : " Point" } ) ) ,
138+ MultiPoint : jest . fn ( ( coords , bbox ) => ( { coords, bbox, type : " MultiPoint" } ) ) ,
139+ LineString : jest . fn ( ( coords , bbox ) => ( { coords, bbox, type : " LineString" } ) ) ,
132140 MultiLineString : jest . fn ( ( multipleCoordinates , bbox ) => ( {
133141 multipleCoordinates,
134142 bbox,
135- type : ' MultiLineString'
143+ type : " MultiLineString" ,
136144 } ) ) ,
137- Polygon : jest . fn ( ( coords , bbox ) => ( { coords, bbox, type : ' Polygon' } ) ) ,
145+ Polygon : jest . fn ( ( coords , bbox ) => ( { coords, bbox, type : " Polygon" } ) ) ,
138146 MultiPolygon : jest . fn ( ( multipleDimensionCoordinates , bbox ) => ( {
139147 multipleDimensionCoordinates,
140148 bbox,
141- type : ' MultiPolygon'
149+ type : " MultiPolygon" ,
142150 } ) ) ,
143- Feature : jest . fn ( )
144- }
145- }
151+ Feature : jest . fn ( ) ,
152+ } ,
153+ } ;
0 commit comments