@@ -215,10 +215,12 @@ describe('mapbox credentials', function() {
215
215
lat : [ 10 , 20 , 30 ]
216
216
} ] , { } , {
217
217
mapboxAccessToken : dummyToken
218
- } ) . catch ( function ( err ) {
218
+ } )
219
+ . catch ( function ( err ) {
219
220
cnt ++ ;
220
221
expect ( err ) . toEqual ( new Error ( constants . mapOnErrorMsg ) ) ;
221
- } ) . then ( function ( ) {
222
+ } )
223
+ . then ( function ( ) {
222
224
expect ( cnt ) . toEqual ( 1 ) ;
223
225
done ( ) ;
224
226
} ) ;
@@ -263,10 +265,12 @@ describe('mapbox credentials', function() {
263
265
}
264
266
} , {
265
267
mapboxAccessToken : ''
266
- } ) . catch ( function ( err ) {
268
+ } )
269
+ . catch ( function ( err ) {
267
270
cnt ++ ;
268
271
expect ( err ) . toEqual ( new Error ( msg ) ) ;
269
- } ) . then ( function ( ) {
272
+ } )
273
+ . then ( function ( ) {
270
274
expect ( cnt ) . toEqual ( 1 ) ;
271
275
done ( ) ;
272
276
} ) ;
@@ -310,22 +314,26 @@ describe('mapbox plots', function() {
310
314
expect ( gd . _fullLayout . mapbox ) . toBeUndefined ( ) ;
311
315
312
316
return Plotly . restyle ( gd , 'visible' , true ) ;
313
- } ) . then ( function ( ) {
317
+ } )
318
+ . then ( function ( ) {
314
319
expect ( countVisibleTraces ( gd , modes ) ) . toEqual ( 2 ) ;
315
320
316
321
return Plotly . restyle ( gd , 'visible' , 'legendonly' , [ 1 ] ) ;
317
- } ) . then ( function ( ) {
322
+ } )
323
+ . then ( function ( ) {
318
324
expect ( countVisibleTraces ( gd , modes ) ) . toEqual ( 1 ) ;
319
325
320
326
return Plotly . restyle ( gd , 'visible' , true ) ;
321
- } ) . then ( function ( ) {
327
+ } )
328
+ . then ( function ( ) {
322
329
expect ( countVisibleTraces ( gd , modes ) ) . toEqual ( 2 ) ;
323
330
324
331
var mockCopy = Lib . extendDeep ( { } , mock ) ;
325
332
mockCopy . data [ 0 ] . visible = false ;
326
333
327
334
return Plotly . newPlot ( gd , mockCopy . data , mockCopy . layout ) ;
328
- } ) . then ( function ( ) {
335
+ } )
336
+ . then ( function ( ) {
329
337
expect ( countVisibleTraces ( gd , modes ) ) . toEqual ( 1 ) ;
330
338
331
339
done ( ) ;
@@ -348,7 +356,8 @@ describe('mapbox plots', function() {
348
356
} ;
349
357
350
358
return Plotly . addTraces ( gd , [ trace ] ) ;
351
- } ) . then ( function ( ) {
359
+ } )
360
+ . then ( function ( ) {
352
361
expect ( countVisibleTraces ( gd , modes ) ) . toEqual ( 2 ) ;
353
362
354
363
var trace = {
@@ -359,11 +368,13 @@ describe('mapbox plots', function() {
359
368
} ;
360
369
361
370
return Plotly . addTraces ( gd , [ trace ] ) ;
362
- } ) . then ( function ( ) {
371
+ } )
372
+ . then ( function ( ) {
363
373
expect ( countVisibleTraces ( gd , modes ) ) . toEqual ( 3 ) ;
364
374
365
375
return Plotly . deleteTraces ( gd , [ 0 , 1 , 2 ] ) ;
366
- } ) . then ( function ( ) {
376
+ } )
377
+ . then ( function ( ) {
367
378
expect ( gd . _fullLayout . mapbox ) . toBeUndefined ( ) ;
368
379
369
380
done ( ) ;
@@ -462,28 +473,32 @@ describe('mapbox plots', function() {
462
473
assertLayout ( 'Mapbox Dark' , [ 0 , 0 ] , 1.234 , [ 80 , 100 , 908 , 270 ] ) ;
463
474
464
475
return Plotly . relayout ( gd , 'mapbox.zoom' , '6' ) ;
465
- } ) . then ( function ( ) {
476
+ } )
477
+ . then ( function ( ) {
466
478
expect ( restyleCnt ) . toEqual ( 0 ) ;
467
479
expect ( relayoutCnt ) . toEqual ( 2 ) ;
468
480
469
481
assertLayout ( 'Mapbox Dark' , [ 0 , 0 ] , 6 , [ 80 , 100 , 908 , 270 ] ) ;
470
482
471
483
return Plotly . relayout ( gd , 'mapbox.style' , 'light' ) ;
472
- } ) . then ( function ( ) {
484
+ } )
485
+ . then ( function ( ) {
473
486
expect ( restyleCnt ) . toEqual ( 0 ) ;
474
487
expect ( relayoutCnt ) . toEqual ( 3 ) ;
475
488
476
489
assertLayout ( 'Mapbox Light' , [ 0 , 0 ] , 6 , [ 80 , 100 , 908 , 270 ] ) ;
477
490
478
491
return Plotly . relayout ( gd , 'mapbox.domain.x' , [ 0 , 0.5 ] ) ;
479
- } ) . then ( function ( ) {
492
+ } )
493
+ . then ( function ( ) {
480
494
expect ( restyleCnt ) . toEqual ( 0 ) ;
481
495
expect ( relayoutCnt ) . toEqual ( 4 ) ;
482
496
483
497
assertLayout ( 'Mapbox Light' , [ 0 , 0 ] , 6 , [ 80 , 100 , 454 , 270 ] ) ;
484
498
485
499
return Plotly . relayout ( gd , 'mapbox.domain.y[0]' , 0.5 ) ;
486
- } ) . then ( function ( ) {
500
+ } )
501
+ . then ( function ( ) {
487
502
expect ( restyleCnt ) . toEqual ( 0 ) ;
488
503
expect ( relayoutCnt ) . toEqual ( 5 ) ;
489
504
@@ -669,7 +684,8 @@ describe('mapbox plots', function() {
669
684
} ;
670
685
671
686
return Plotly . extendTraces ( gd , update , [ 0 , 1 ] ) ;
672
- } ) . then ( function ( ) {
687
+ } )
688
+ . then ( function ( ) {
673
689
assertDataPts ( [ 5 , 5 ] ) ;
674
690
675
691
done ( ) ;
0 commit comments