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() {
474474 expect ( gd . data [ 2 ] . uid ) . toBeDefined ( ) ;
475475 expect ( PlotlyInternal . redraw ) . not . toHaveBeenCalled ( ) ;
476476 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 ) ;
477488
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 ] ) ;
478492 } ) ;
479493 } ) ;
480494
You can’t perform that action at this time.
0 commit comments