@@ -682,6 +682,25 @@ describe('Animate API details', function() {
682
682
} ) . catch ( fail ) . then ( done ) ;
683
683
} ) ;
684
684
685
+ it ( 'emits warning if strings are not used and this creates ambiguity' , function ( done ) {
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 ] } ] } ] ) } )
692
+ . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) } )
693
+ . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) } )
694
+ . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) } )
695
+ . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) } )
696
+ . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) } )
697
+ . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) } )
698
+ . then ( function ( ) {
699
+ // Five (`var numericNameWarningCountLimit = 5`) warnings and one warning saying that there won't be more warnings
700
+ expect ( Lib . warn . calls . count ( ) ) . toEqual ( 5 + 1 ) ;
701
+ } ) . catch ( fail ) . then ( done ) ;
702
+ } ) ;
703
+
685
704
it ( 'ignores null and undefined frames' , function ( done ) {
686
705
var cnt = 0 ;
687
706
gd . on ( 'plotly_animatingframe' , function ( ) { cnt ++ ; } ) ;
0 commit comments