@@ -201,11 +201,12 @@ describe('Test geo interactions', function() {
201
201
expect ( countTraces ( 'scattergeo' ) ) . toBe ( 0 ) ;
202
202
expect ( countTraces ( 'choropleth' ) ) . toBe ( 1 ) ;
203
203
204
- Plotly . restyle ( gd , 'visible' , true , [ 0 ] ) . then ( function ( ) {
205
- expect ( countTraces ( 'scattergeo' ) ) . toBe ( 1 ) ;
206
- expect ( countTraces ( 'choropleth' ) ) . toBe ( 1 ) ;
207
- done ( ) ;
208
- } ) ;
204
+ return Plotly . restyle ( gd , 'visible' , true , [ 0 ] ) ;
205
+ } ) . then ( function ( ) {
206
+ expect ( countTraces ( 'scattergeo' ) ) . toBe ( 1 ) ;
207
+ expect ( countTraces ( 'choropleth' ) ) . toBe ( 1 ) ;
208
+
209
+ done ( ) ;
209
210
} ) ;
210
211
} ) ;
211
212
@@ -217,11 +218,12 @@ describe('Test geo interactions', function() {
217
218
expect ( countTraces ( 'scattergeo' ) ) . toBe ( 1 ) ;
218
219
expect ( countTraces ( 'choropleth' ) ) . toBe ( 0 ) ;
219
220
220
- Plotly . restyle ( gd , 'visible' , true , [ 1 ] ) . then ( function ( ) {
221
- expect ( countTraces ( 'scattergeo' ) ) . toBe ( 1 ) ;
222
- expect ( countTraces ( 'choropleth' ) ) . toBe ( 1 ) ;
223
- done ( ) ;
224
- } ) ;
221
+ return Plotly . restyle ( gd , 'visible' , true , [ 1 ] ) ;
222
+ } ) . then ( function ( ) {
223
+ expect ( countTraces ( 'scattergeo' ) ) . toBe ( 1 ) ;
224
+ expect ( countTraces ( 'choropleth' ) ) . toBe ( 1 ) ;
225
+
226
+ done ( ) ;
225
227
} ) ;
226
228
} ) ;
227
229
@@ -240,20 +242,21 @@ describe('Test geo interactions', function() {
240
242
expect ( countGeos ( ) ) . toBe ( 1 ) ;
241
243
expect ( countColorBars ( ) ) . toBe ( 1 ) ;
242
244
243
- Plotly . deleteTraces ( gd , [ 0 ] ) . then ( function ( ) {
244
- expect ( countTraces ( 'scattergeo' ) ) . toBe ( 0 ) ;
245
- expect ( countTraces ( 'choropleth' ) ) . toBe ( 0 ) ;
246
- expect ( countGeos ( ) ) . toBe ( 1 ) ;
247
- expect ( countColorBars ( ) ) . toBe ( 0 ) ;
248
-
249
- Plotly . relayout ( gd , 'geo' , null ) . then ( function ( ) {
250
- expect ( countTraces ( 'scattergeo' ) ) . toBe ( 0 ) ;
251
- expect ( countTraces ( 'choropleth' ) ) . toBe ( 0 ) ;
252
- expect ( countGeos ( ) ) . toBe ( 0 ) ;
253
- expect ( countColorBars ( ) ) . toBe ( 0 ) ;
254
- done ( ) ;
255
- } ) ;
256
- } ) ;
245
+ return Plotly . deleteTraces ( gd , [ 0 ] ) ;
246
+ } ) . then ( function ( ) {
247
+ expect ( countTraces ( 'scattergeo' ) ) . toBe ( 0 ) ;
248
+ expect ( countTraces ( 'choropleth' ) ) . toBe ( 0 ) ;
249
+ expect ( countGeos ( ) ) . toBe ( 1 ) ;
250
+ expect ( countColorBars ( ) ) . toBe ( 0 ) ;
251
+
252
+ return Plotly . relayout ( gd , 'geo' , null ) ;
253
+ } ) . then ( function ( ) {
254
+ expect ( countTraces ( 'scattergeo' ) ) . toBe ( 0 ) ;
255
+ expect ( countTraces ( 'choropleth' ) ) . toBe ( 0 ) ;
256
+ expect ( countGeos ( ) ) . toBe ( 0 ) ;
257
+ expect ( countColorBars ( ) ) . toBe ( 0 ) ;
258
+
259
+ done ( ) ;
257
260
} ) ;
258
261
} ) ;
259
262
} ) ;
0 commit comments