@@ -272,9 +272,9 @@ describe('@gl parcoords', function() {
272272 expect ( gd . data [ 0 ] . dimensions [ 1 ] . range ) . toBeDefined ( ) ;
273273 expect ( gd . data [ 0 ] . dimensions [ 1 ] . range ) . toEqual ( [ 0 , 700000 ] ) ;
274274 expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . not . toBeDefined ( ) ;
275-
276- done ( ) ;
277- } ) ;
275+ } )
276+ . catch ( fail )
277+ . then ( done ) ;
278278 } ) ;
279279
280280 it ( 'Do something sensible if there is no panel i.e. dimension count is less than 2' , function ( done ) {
@@ -291,9 +291,9 @@ describe('@gl parcoords', function() {
291291 expect ( gd . data [ 0 ] . dimensions [ 0 ] . range ) . not . toBeDefined ( ) ;
292292 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeDefined ( ) ;
293293 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toEqual ( [ 200 , 700 ] ) ;
294-
295- done ( ) ;
296- } ) ;
294+ } )
295+ . catch ( fail )
296+ . then ( done ) ;
297297 } ) ;
298298
299299 it ( 'Does not error with zero dimensions' , function ( done ) {
@@ -302,11 +302,13 @@ describe('@gl parcoords', function() {
302302 var gd = createGraphDiv ( ) ;
303303
304304 Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
305+
305306 expect ( gd . data . length ) . toEqual ( 1 ) ;
306307 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 0 ) ;
307308 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 0 ) ;
308- done ( ) ;
309- } ) ;
309+ } )
310+ . catch ( fail )
311+ . then ( done ) ;
310312 } ) ;
311313
312314 it ( 'Works with duplicate dimension labels' , function ( done ) {
@@ -322,8 +324,9 @@ describe('@gl parcoords', function() {
322324 expect ( gd . data . length ) . toEqual ( 1 ) ;
323325 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
324326 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
325- done ( ) ;
326- } ) ;
327+ } )
328+ . catch ( fail )
329+ . then ( done ) ;
327330 } ) ;
328331
329332 it ( 'Works with a single line; also, use a longer color array than the number of lines' , function ( done ) {
@@ -349,8 +352,9 @@ describe('@gl parcoords', function() {
349352 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
350353 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
351354 expect ( gd . data [ 0 ] . dimensions [ 0 ] . values . length ) . toEqual ( 1 ) ;
352- done ( ) ;
353- } ) ;
355+ } )
356+ . catch ( fail )
357+ . then ( done ) ;
354358 } ) ;
355359
356360 it ( 'Does not raise an error with zero lines and no specified range' , function ( done ) {
@@ -373,8 +377,9 @@ describe('@gl parcoords', function() {
373377 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
374378 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 0 ) ;
375379 expect ( gd . data [ 0 ] . dimensions [ 0 ] . values . length ) . toEqual ( 0 ) ;
376- done ( ) ;
377- } ) ;
380+ } )
381+ . catch ( fail )
382+ . then ( done ) ;
378383 } ) ;
379384
380385 it ( 'Works with non-finite `values` elements' , function ( done ) {
@@ -401,8 +406,9 @@ describe('@gl parcoords', function() {
401406 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
402407 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
403408 expect ( gd . data [ 0 ] . dimensions [ 0 ] . values . length ) . toEqual ( values [ 0 ] . length ) ;
404- done ( ) ;
405- } ) ;
409+ } )
410+ . catch ( fail )
411+ . then ( done ) ;
406412 } ) ;
407413
408414 it ( '@noCI Works with 60 dimensions' , function ( done ) {
@@ -431,8 +437,9 @@ describe('@gl parcoords', function() {
431437 expect ( gd . data . length ) . toEqual ( 1 ) ;
432438 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 60 ) ;
433439 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 60 ) ;
434- done ( ) ;
435- } ) ;
440+ } )
441+ . catch ( fail )
442+ . then ( done ) ;
436443 } ) ;
437444
438445 it ( '@noCI Truncates 60+ dimensions to 60' , function ( done ) {
@@ -459,8 +466,9 @@ describe('@gl parcoords', function() {
459466 expect ( gd . data . length ) . toEqual ( 1 ) ;
460467 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 60 ) ;
461468 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 60 ) ;
462- done ( ) ;
463- } ) ;
469+ } )
470+ . catch ( fail )
471+ . then ( done ) ;
464472 } ) ;
465473
466474 it ( '@noCI Truncates dimension values to the shortest array, retaining only 3 lines' , function ( done ) {
@@ -488,8 +496,9 @@ describe('@gl parcoords', function() {
488496 expect ( gd . data . length ) . toEqual ( 1 ) ;
489497 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 60 ) ;
490498 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 60 ) ;
491- done ( ) ;
492- } ) ;
499+ } )
500+ . catch ( fail )
501+ . then ( done ) ;
493502 } ) ;
494503
495504 it ( 'Skip dimensions which are not plain objects or whose `values` is not an array' , function ( done ) {
@@ -521,8 +530,9 @@ describe('@gl parcoords', function() {
521530 expect ( gd . data . length ) . toEqual ( 1 ) ;
522531 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 5 ) ; // it's still five, but ...
523532 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 3 ) ; // only 3 axes shown
524- done ( ) ;
525- } ) ;
533+ } )
534+ . catch ( fail )
535+ . then ( done ) ;
526536 } ) ;
527537
528538
@@ -539,7 +549,9 @@ describe('@gl parcoords', function() {
539549 y : [ 0.05 , 0.85 ]
540550 } ;
541551 gd = createGraphDiv ( ) ;
542- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( done ) ;
552+ Plotly . plot ( gd , mockCopy . data , mockCopy . layout )
553+ . catch ( fail )
554+ . then ( done ) ;
543555 } ) ;
544556
545557 it ( '`Plotly.plot` should have proper fields on `gd.data` on initial rendering' , function ( ) {
@@ -584,9 +596,9 @@ describe('@gl parcoords', function() {
584596 expect ( gd . data [ 1 ] . dimensions [ 1 ] . constraintrange ) . not . toBeDefined ( ) ;
585597
586598 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 20 ) ; // one dimension is `visible: false`
587-
588- done ( ) ;
589- } ) ;
599+ } )
600+ . catch ( fail )
601+ . then ( done ) ;
590602
591603 } ) ;
592604
@@ -604,9 +616,9 @@ describe('@gl parcoords', function() {
604616 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeDefined ( ) ;
605617 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toEqual ( [ 100000 , 150000 ] ) ;
606618 expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . not . toBeDefined ( ) ;
607-
608- done ( ) ;
609- } ) ;
619+ } )
620+ . catch ( fail )
621+ . then ( done ) ;
610622
611623 } ) ;
612624
@@ -632,6 +644,7 @@ describe('@gl parcoords', function() {
632644 . then ( restyleDimension ( 'constraintrange' , [ [ 0 , 1 ] ] ) )
633645 . then ( restyleDimension ( 'values' , [ [ 0 , 0.1 , 0.4 , 1 , 2 , 0 , 0.1 , 0.4 , 1 , 2 ] ] ) )
634646 . then ( restyleDimension ( 'visible' , false ) )
647+ . catch ( fail )
635648 . then ( done ) ;
636649 } ) ;
637650
@@ -652,11 +665,9 @@ describe('@gl parcoords', function() {
652665 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeDefined ( ) ;
653666 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toEqual ( [ 100000 , 150000 ] ) ;
654667 expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . not . toBeDefined ( ) ;
655-
656- done ( ) ;
657- } ) ;
658-
659-
668+ } )
669+ . catch ( fail )
670+ . then ( done ) ;
660671 } ) ;
661672
662673 it ( 'Should emit a \'plotly_restyle\' event' , function ( done ) {
@@ -677,10 +688,11 @@ describe('@gl parcoords', function() {
677688
678689 expect ( tester . get ( ) ) . toBe ( false ) ;
679690 Plotly . restyle ( gd , 'line.colorscale' , 'Viridis' )
680- . then ( window . setTimeout ( function ( ) {
681- expect ( tester . get ( ) ) . toBe ( true ) ;
682- done ( ) ;
683- } , 0 ) ) ;
691+ . then ( function ( ) {
692+ expect ( tester . get ( ) ) . toBe ( true ) ;
693+ } )
694+ . catch ( fail )
695+ . then ( done ) ;
684696
685697 } ) ;
686698
@@ -715,20 +727,24 @@ describe('@gl parcoords', function() {
715727 mouseEvent ( 'mousemove' , 315 , 218 ) ;
716728 mouseEvent ( 'mouseover' , 315 , 218 ) ;
717729
718- window . setTimeout ( function ( ) {
730+ new Promise ( function ( resolve ) {
731+ window . setTimeout ( function ( ) {
719732
720- expect ( hoverTester . get ( ) ) . toBe ( true ) ;
733+ expect ( hoverTester . get ( ) ) . toBe ( true ) ;
721734
722- mouseEvent ( 'mousemove' , 329 , 153 ) ;
723- mouseEvent ( 'mouseover' , 329 , 153 ) ;
735+ mouseEvent ( 'mousemove' , 329 , 153 ) ;
736+ mouseEvent ( 'mouseover' , 329 , 153 ) ;
724737
725- window . setTimeout ( function ( ) {
738+ window . setTimeout ( function ( ) {
726739
727- expect ( unhoverTester . get ( ) ) . toBe ( true ) ;
728- done ( ) ;
729- } , 20 ) ;
740+ expect ( unhoverTester . get ( ) ) . toBe ( true ) ;
741+ resolve ( ) ;
742+ } , 20 ) ;
730743
731- } , 20 ) ;
744+ } , 20 ) ;
745+ } )
746+ . catch ( fail )
747+ . then ( done ) ;
732748
733749 } ) ;
734750
@@ -747,10 +763,9 @@ describe('@gl parcoords', function() {
747763 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeDefined ( ) ;
748764 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toEqual ( [ 100000 , 150000 ] ) ;
749765 expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . not . toBeDefined ( ) ;
750-
751- done ( ) ;
752- } ) ;
753-
766+ } )
767+ . catch ( fail )
768+ . then ( done ) ;
754769 } ) ;
755770
756771 it ( 'Calling `Plotly.relayout`with object should amend the preexisting parcoords' , function ( done ) {
@@ -768,10 +783,9 @@ describe('@gl parcoords', function() {
768783 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toBeDefined ( ) ;
769784 expect ( gd . data [ 0 ] . dimensions [ 0 ] . constraintrange ) . toEqual ( [ 100000 , 150000 ] ) ;
770785 expect ( gd . data [ 0 ] . dimensions [ 1 ] . constraintrange ) . not . toBeDefined ( ) ;
771-
772- done ( ) ;
773- } ) ;
774-
786+ } )
787+ . catch ( fail )
788+ . then ( done ) ;
775789 } ) ;
776790
777791 it ( '@flaky Calling `Plotly.animate` with patches targeting `dimensions` attributes should do the right thing' , function ( done ) {
@@ -827,12 +841,13 @@ describe('@gl parcoords', function() {
827841
828842 expect ( gd . data . length ) . toEqual ( 1 ) ;
829843
830- Plotly . deleteTraces ( gd , 0 ) . then ( function ( ) {
844+ return Plotly . deleteTraces ( gd , 0 ) . then ( function ( ) {
831845 expect ( d3 . selectAll ( '.gl-canvas' ) . node ( 0 ) ) . toEqual ( null ) ;
832846 expect ( gd . data . length ) . toEqual ( 0 ) ;
833- done ( ) ;
834847 } ) ;
835- } ) ;
848+ } )
849+ . catch ( fail )
850+ . then ( done ) ;
836851 } ) ;
837852
838853 it ( 'Plotly.deleteTraces with two traces removes the deleted plot' , function ( done ) {
@@ -864,8 +879,9 @@ describe('@gl parcoords', function() {
864879 expect ( document . querySelectorAll ( '.gl-canvas' ) . length ) . toEqual ( 0 ) ;
865880 expect ( document . querySelectorAll ( '.y-axis' ) . length ) . toEqual ( 0 ) ;
866881 expect ( gd . data . length ) . toEqual ( 0 ) ;
867- done ( ) ;
868- } ) ;
882+ } )
883+ . catch ( fail )
884+ . then ( done ) ;
869885 } ) ;
870886
871887 it ( 'Calling `Plotly.restyle` with zero panels left should erase lines' , function ( done ) {
@@ -894,8 +910,9 @@ describe('@gl parcoords', function() {
894910 } while ( ! foundPixel && i < imageArray . length ) ;
895911 expect ( foundPixel ) . toEqual ( false ) ;
896912 } ) ;
897- done ( ) ;
898- } ) ;
913+ } )
914+ . catch ( fail )
915+ . then ( done ) ;
899916 } ) ;
900917
901918 describe ( 'Having two datasets' , function ( ) {
@@ -925,9 +942,9 @@ describe('@gl parcoords', function() {
925942 expect ( 1 ) . toEqual ( 1 ) ;
926943 expect ( document . querySelectorAll ( '.gl-container' ) . length ) . toEqual ( 1 ) ;
927944 expect ( gd . data . length ) . toEqual ( 2 ) ;
928-
929- done ( ) ;
930- } ) ;
945+ } )
946+ . catch ( fail )
947+ . then ( done ) ;
931948 } ) ;
932949
933950 it ( 'Plotly.addTraces should add a new parcoords row' , function ( done ) {
@@ -952,10 +969,9 @@ describe('@gl parcoords', function() {
952969 . then ( function ( ) {
953970 expect ( document . querySelectorAll ( '.gl-container' ) . length ) . toEqual ( 1 ) ;
954971 expect ( gd . data . length ) . toEqual ( 2 ) ;
955-
956- done ( ) ;
957- } ) ;
958-
972+ } )
973+ . catch ( fail )
974+ . then ( done ) ;
959975 } ) ;
960976
961977 it ( 'Plotly.restyle should update the existing parcoords row' , function ( done ) {
@@ -1001,10 +1017,9 @@ describe('@gl parcoords', function() {
10011017
10021018 expect ( document . querySelectorAll ( '.gl-container' ) . length ) . toEqual ( 1 ) ;
10031019 expect ( gd . data . length ) . toEqual ( 1 ) ;
1004-
1005- done ( ) ;
1006- } ) ;
1007-
1020+ } )
1021+ . catch ( fail )
1022+ . then ( done ) ;
10081023 } ) ;
10091024 } ) ;
10101025 } ) ;
0 commit comments