File tree 1 file changed +26
-0
lines changed
Filter options
1 file changed +26
-0
lines changed
Original file line number Diff line number Diff line change @@ -768,4 +768,30 @@ describe('animating scatter traces', function() {
768
768
expect ( trace . style ( 'opacity' ) ) . toEqual ( '0.1' ) ;
769
769
} ) . catch ( fail ) . then ( done ) ;
770
770
} ) ;
771
+
772
+ it ( 'places animate on the main plotly.js queue' , function ( done ) {
773
+ Plotly . plot ( gd , [ {
774
+ x : [ 1 , 2 , 3 ] ,
775
+ y : [ 4 , 5 , 6 ] ,
776
+ opacity : 1
777
+ } ] ) . then ( function ( ) {
778
+ gd . _promises . push ( delay ( 100 ) ( ) ) ;
779
+ var checked = false ;
780
+
781
+ Plotly . animate ( gd , [ {
782
+ data : [ { 'line.color' : 'red' } ]
783
+ } ] , {
784
+ frame : { duration : 0 , redraw : false } ,
785
+ mode : 'immediate'
786
+ } ) . then ( function ( ) {
787
+ expect ( gd . _fullData [ 0 ] . line . color ) . toBe ( 'red' ) ;
788
+ expect ( checked ) . toBe ( true ) ;
789
+ } ) . catch ( fail ) . then ( done ) ;
790
+
791
+ setTimeout ( function ( ) {
792
+ expect ( gd . _fullData [ 0 ] . line . color ) . not . toBe ( 'red' ) ;
793
+ checked = true ;
794
+ } , 50 ) ;
795
+ } ) . catch ( fail ) ;
796
+ } ) ;
771
797
} ) ;
You can’t perform that action at this time.
0 commit comments