@@ -201,11 +201,12 @@ describe('Test geo interactions', function() {
201201 expect ( countTraces ( 'scattergeo' ) ) . toBe ( 0 ) ;
202202 expect ( countTraces ( 'choropleth' ) ) . toBe ( 1 ) ;
203203
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 ( ) ;
209210 } ) ;
210211 } ) ;
211212
@@ -217,11 +218,12 @@ describe('Test geo interactions', function() {
217218 expect ( countTraces ( 'scattergeo' ) ) . toBe ( 1 ) ;
218219 expect ( countTraces ( 'choropleth' ) ) . toBe ( 0 ) ;
219220
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 ( ) ;
225227 } ) ;
226228 } ) ;
227229
@@ -240,20 +242,21 @@ describe('Test geo interactions', function() {
240242 expect ( countGeos ( ) ) . toBe ( 1 ) ;
241243 expect ( countColorBars ( ) ) . toBe ( 1 ) ;
242244
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 ( ) ;
257260 } ) ;
258261 } ) ;
259262 } ) ;
0 commit comments