@@ -684,13 +684,26 @@ describe('Animate API details', function() {
684
684
685
685
it ( 'emits warning if strings are not used and this creates ambiguity' , function ( done ) {
686
686
spyOn ( Lib , 'warn' ) ;
687
- Plotly . addFrames ( gd , [ { name : '8' , data : [ { x : [ 8 , 7 , 6 ] } ] } ] )
688
- . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
689
- . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
690
- . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
691
- . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
687
+
688
+ // Test with both multiframe additions and repeated `addFrames` calls - both should count toward the warn limit
689
+ Plotly . addFrames ( gd , [
690
+ { name : 8 , data : [ { x : [ 8 , 7 , 6 ] } ] } ,
691
+ { name : 8888 , data : [ { x : [ 8 , 7 , 6 ] } ] } ,
692
+ { name : 8 , data : [ { x : [ 8 , 7 , 6 ] } ] } ,
693
+ { name : '8' , data : [ { x : [ 8 , 7 , 6 ] } ] }
694
+ ] )
695
+ . then ( function ( ) {
696
+ // so far, two warnings
697
+ expect ( Lib . warn . calls . count ( ) ) . toEqual ( 2 ) ;
698
+ return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ;
699
+ } )
692
700
. then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
693
701
. then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
702
+ . then ( function ( ) {
703
+ // so far, 5 + 1 warnings
704
+ expect ( Lib . warn . calls . count ( ) ) . toEqual ( 5 + 1 ) ;
705
+ return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ;
706
+ } )
694
707
. then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
695
708
. then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
696
709
. then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
0 commit comments