@@ -5,6 +5,7 @@ var Lib = require('@src/lib');
55var createGraphDiv = require ( '../assets/create_graph_div' ) ;
66var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
77var customAssertions = require ( '../assets/custom_assertions' ) ;
8+ var failTest = require ( '../assets/fail_test' ) ;
89
910var assertDims = customAssertions . assertDims ;
1011var assertStyle = customAssertions . assertStyle ;
@@ -72,9 +73,9 @@ describe('groupby', function() {
7273 expect ( gd . _fullData [ 1 ] . transforms [ 0 ] . _indexToPoints ) . toEqual ( { 0 : [ 2 ] , 1 : [ 4 ] , 2 : [ 5 ] } ) ;
7374
7475 assertDims ( [ 4 , 3 ] ) ;
75-
76- done ( ) ;
77- } ) ;
76+ } )
77+ . catch ( failTest )
78+ . then ( done ) ;
7879 } ) ;
7980
8081 it ( 'Accepts deprecated object notation for styles' , function ( done ) {
@@ -122,7 +123,9 @@ describe('groupby', function() {
122123
123124 expect ( gd . _fullData [ 0 ] . marker . opacity ) . toEqual ( 1 ) ;
124125 expect ( gd . _fullData [ 1 ] . marker . opacity ) . toEqual ( 1 ) ;
125- } ) . then ( done ) ;
126+ } )
127+ . catch ( failTest )
128+ . then ( done ) ;
126129
127130 // The final test for restyle updates using deprecated syntax
128131 // is ommitted since old style syntax is *only* sanitized on
@@ -174,9 +177,9 @@ describe('groupby', function() {
174177 [ 'rgb(0, 128, 0)' , 'rgb(255, 0, 0)' ] ,
175178 [ 0.4 , 0.4 ]
176179 ) ;
177-
178- done ( ) ;
179- } ) ;
180+ } )
181+ . catch ( failTest )
182+ . then ( done ) ;
180183 } ) ;
181184
182185 it ( 'Plotly.extendTraces should work' , function ( done ) {
@@ -202,9 +205,9 @@ describe('groupby', function() {
202205 expect ( gd . _fullData [ 1 ] . x . length ) . toEqual ( 5 ) ;
203206
204207 assertDims ( [ 5 , 5 ] ) ;
205-
206- done ( ) ;
207- } ) ;
208+ } )
209+ . catch ( failTest )
210+ . then ( done ) ;
208211 } ) ;
209212
210213 it ( 'Plotly.deleteTraces should work' , function ( done ) {
@@ -222,9 +225,9 @@ describe('groupby', function() {
222225 return Plotly . deleteTraces ( gd , [ 0 ] ) ;
223226 } ) . then ( function ( ) {
224227 assertDims ( [ ] ) ;
225-
226- done ( ) ;
227- } ) ;
228+ } )
229+ . catch ( failTest )
230+ . then ( done ) ;
228231 } ) ;
229232
230233 it ( 'toggling trace visibility should work' , function ( done ) {
@@ -246,9 +249,9 @@ describe('groupby', function() {
246249 return Plotly . restyle ( gd , 'visible' , [ true , true ] , [ 0 , 1 ] ) ;
247250 } ) . then ( function ( ) {
248251 assertDims ( [ 4 , 3 , 4 , 3 ] ) ;
249-
250- done ( ) ;
251- } ) ;
252+ } )
253+ . catch ( failTest )
254+ . then ( done ) ;
252255 } ) ;
253256 } ) ;
254257
@@ -359,9 +362,9 @@ describe('groupby', function() {
359362 expect ( gd . _fullData [ 1 ] . y ) . toEqual ( [ 3 , 2 , 3 ] ) ;
360363
361364 assertDims ( [ 4 , 3 ] ) ;
362-
363- done ( ) ;
364- } ) ;
365+ } )
366+ . catch ( failTest )
367+ . then ( done ) ;
365368 } ) ;
366369
367370 it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
@@ -376,9 +379,9 @@ describe('groupby', function() {
376379
377380 expect ( gd . _fullData . length ) . toEqual ( 1 ) ;
378381 assertDims ( [ 7 ] ) ;
379-
380- done ( ) ;
381- } ) ;
382+ } )
383+ . catch ( failTest )
384+ . then ( done ) ;
382385 } ) ;
383386
384387 it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
@@ -396,9 +399,9 @@ describe('groupby', function() {
396399 expect ( gd . _fullData [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
397400
398401 assertDims ( [ 7 ] ) ;
399-
400- done ( ) ;
401- } ) ;
402+ } )
403+ . catch ( failTest )
404+ . then ( done ) ;
402405 } ) ;
403406
404407 it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
@@ -417,9 +420,9 @@ describe('groupby', function() {
417420 expect ( gd . _fullData [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
418421
419422 assertDims ( [ 7 ] ) ;
420-
421- done ( ) ;
422- } ) ;
423+ } )
424+ . catch ( failTest )
425+ . then ( done ) ;
423426 } ) ;
424427
425428 it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
@@ -438,9 +441,9 @@ describe('groupby', function() {
438441 expect ( gd . _fullData [ 0 ] . y ) . toEqual ( [ 1 , 2 , 3 , 1 , 2 , 3 , 1 ] ) ;
439442
440443 assertDims ( [ 7 ] ) ;
441-
442- done ( ) ;
443- } ) ;
444+ } )
445+ . catch ( failTest )
446+ . then ( done ) ;
444447 } ) ;
445448 } ) ;
446449
@@ -478,9 +481,9 @@ describe('groupby', function() {
478481 expect ( gd . _fullData [ 1 ] . marker . line . width ) . toEqual ( [ 4 , 2 , 3 ] ) ;
479482
480483 assertDims ( [ 4 , 3 ] ) ;
481-
482- done ( ) ;
483- } ) ;
484+ } )
485+ . catch ( failTest )
486+ . then ( done ) ;
484487 } ;
485488 }
486489
@@ -611,8 +614,9 @@ describe('groupby', function() {
611614 Plotly . plot ( gd , data ) . then ( function ( ) {
612615 expect ( gd . _fullData [ 0 ] . marker . line . color ) . toEqual ( [ 'orange' , 'red' , 'cyan' , 'pink' ] ) ;
613616 expect ( gd . _fullData [ 1 ] . marker . line . color ) . toEqual ( 'yellow' ) ;
614- done ( ) ;
615- } ) ;
617+ } )
618+ . catch ( failTest )
619+ . then ( done ) ;
616620 } ) ;
617621
618622 it ( 'passes with no explicit styling for the individual group' , test ( mockData4 ) ) ;
@@ -649,9 +653,9 @@ describe('groupby', function() {
649653 expect ( gd . _fullData [ 0 ] . marker . line . width ) . toEqual ( [ 4 , 2 , 4 , 2 , 2 , 3 , 3 ] ) ;
650654
651655 assertDims ( [ 7 ] ) ;
652-
653- done ( ) ;
654- } ) ;
656+ } )
657+ . catch ( failTest )
658+ . then ( done ) ;
655659 } ;
656660 }
657661
0 commit comments