File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -474,7 +474,21 @@ describe('Test plot api', function() {
474
474
expect ( gd . data [ 2 ] . uid ) . toBeDefined ( ) ;
475
475
expect ( PlotlyInternal . redraw ) . not . toHaveBeenCalled ( ) ;
476
476
expect ( PlotlyInternal . moveTraces ) . toHaveBeenCalledWith ( gd , [ - 1 ] , [ 0 ] ) ;
477
+ } ) ;
478
+
479
+ it ( 'should work when adding an existing trace' , function ( ) {
480
+ Plotly . addTraces ( gd , gd . data [ 0 ] ) ;
481
+
482
+ expect ( gd . data . length ) . toEqual ( 3 ) ;
483
+ expect ( gd . data [ 0 ] ) . not . toBe ( gd . data [ 2 ] ) ;
484
+ } ) ;
485
+
486
+ it ( 'should work when duplicating the existing data' , function ( ) {
487
+ Plotly . addTraces ( gd , gd . data ) ;
477
488
489
+ expect ( gd . data . length ) . toEqual ( 4 )
490
+ expect ( gd . data [ 0 ] ) . not . toBe ( gd . data [ 2 ] ) ;
491
+ expect ( gd . data [ 1 ] ) . not . toBe ( gd . data [ 3 ] ) ;
478
492
} ) ;
479
493
} ) ;
480
494
You can’t perform that action at this time.
0 commit comments