@@ -30,14 +30,23 @@ describe('Map', () => {
3030 } ) ;
3131
3232 it ( 'Should render the map correctly' , ( ) => {
33- const MapboxMap = ReactMapboxGl ( { accessToken : '' , mapInstance : getMock ( ) as any } ) ;
33+ const MapboxMap = ReactMapboxGl ( {
34+ accessToken : '' ,
35+ mapInstance : getMock ( ) as any
36+ } ) ;
3437 mount ( < MapboxMap style = "" /> ) ;
3538 } ) ;
3639
3740 it ( 'Should call fitBounds with the right parameters' , ( ) => {
38- const fitBoundsValues : FitBounds = [ [ 0 , 1 ] , [ 2 , 3 ] ] ;
41+ const fitBoundsValues : FitBounds = [
42+ [ 0 , 1 ] ,
43+ [ 2 , 3 ]
44+ ] ;
3945 const fitBoundsOptions = { linear : true } ;
40- const MapboxMap = ReactMapboxGl ( { accessToken : '' , mapInstance : getMock ( ) as any } ) ;
46+ const MapboxMap = ReactMapboxGl ( {
47+ accessToken : '' ,
48+ mapInstance : getMock ( ) as any
49+ } ) ;
4150
4251 mount (
4352 < MapboxMap
@@ -54,17 +63,20 @@ describe('Map', () => {
5463
5564 it ( 'Should update fitBounds if fitBoundsOptions changes' , ( ) => {
5665 const flyTo = jest . fn ( ) ;
57- const fitBoundsValues : FitBounds = [ [ 0 , 1 ] , [ 2 , 3 ] ] ;
66+ const fitBoundsValues : FitBounds = [
67+ [ 0 , 1 ] ,
68+ [ 2 , 3 ]
69+ ] ;
5870 const fitBoundsOptions = { offset : [ 150 , 0 ] as [ number , number ] } ;
5971 const newFitBoundsOptions = { offset : [ 0 , 0 ] } ;
6072
6173 const MapboxMap = ReactMapboxGl ( {
62- accessToken : '' ,
63- mapInstance : getMock ( {
64- flyTo,
65- fitBounds : mockfitBounds
66- } ) as any
67- } ) ;
74+ accessToken : '' ,
75+ mapInstance : getMock ( {
76+ flyTo,
77+ fitBounds : mockfitBounds
78+ } ) as any
79+ } ) ;
6880
6981 const wrapper = mount (
7082 < MapboxMap
@@ -80,9 +92,12 @@ describe('Map', () => {
8092 } ) ;
8193
8294 it . skip ( 'Should calc the center from fitbounds if center is not given' , ( ) => {
83- const fitBoundsValues : FitBounds = [ [ 0 , 3 ] , [ 2 , 9 ] ] ;
84-
85- const MapboxMap = ReactMapboxGl ( { accessToken : '' , mapInstance : getMock ( ) as any } ) ;
95+ const fitBoundsValues : FitBounds = [
96+ [ 0 , 3 ] ,
97+ [ 2 , 9 ]
98+ ] ;
99+ const mockMap = getMock ( ) as any ;
100+ const MapboxMap = ReactMapboxGl ( { accessToken : '' , mapInstance : mockMap } ) ;
86101
87102 mount ( < MapboxMap style = "" fitBounds = { fitBoundsValues } /> ) ;
88103
@@ -92,7 +107,10 @@ describe('Map', () => {
92107 } ) ;
93108
94109 it ( 'Should listen onStyleLoad event' , ( ) => {
95- const MapboxMap = ReactMapboxGl ( { accessToken : '' , mapInstance : getMock ( ) as any } ) ;
110+ const MapboxMap = ReactMapboxGl ( {
111+ accessToken : '' ,
112+ mapInstance : getMock ( ) as any
113+ } ) ;
96114
97115 mount ( < MapboxMap style = "" onStyleLoad = { jest . fn ( ) } /> ) ;
98116
@@ -118,7 +136,10 @@ describe('Map', () => {
118136
119137 it ( 'Should update maxBounds' , ( ) => {
120138 const flyTo = jest . fn ( ) ;
121- const maxBoundsProps = [ [ 1 , 0 ] , [ 0 , 1 ] ] ;
139+ const maxBoundsProps = [
140+ [ 1 , 0 ] ,
141+ [ 0 , 1 ]
142+ ] ;
122143 const mockMaxBounds = jest . fn ( ) ;
123144
124145 const MapboxMap = ReactMapboxGl ( {
0 commit comments