@@ -684,13 +684,26 @@ describe('Animate API details', function() {
684684
685685 it ( 'emits warning if strings are not used and this creates ambiguity' , function ( done ) {
686686 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+ } )
692700 . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
693701 . 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+ } )
694707 . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
695708 . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
696709 . then ( function ( ) { return Plotly . addFrames ( gd , [ { name : 8 , data : [ { x : [ 3 , 2 , 1 ] } ] } ] ) ; } )
0 commit comments