@@ -2117,6 +2117,41 @@ describe('Plotly.react and uirevision attributes', function() {
21172117 } )
21182118 . then ( done , done . fail ) ;
21192119 } ) ;
2120+
2121+ it ( 'preserves icicle level changes' , function ( done ) {
2122+ function assertLevel ( msg , exp ) {
2123+ expect ( gd . _fullData [ 0 ] . level ) . toBe ( exp , msg ) ;
2124+ }
2125+
2126+ Plotly . react ( gd , [ {
2127+ type : 'icicle' ,
2128+ labels : [ 'Eve' , 'Cain' , 'Seth' , 'Enos' , 'Noam' , 'Abel' , 'Awan' , 'Enoch' , 'Azura' ] ,
2129+ parents : [ '' , 'Eve' , 'Eve' , 'Seth' , 'Seth' , 'Eve' , 'Eve' , 'Awan' , 'Eve' ] ,
2130+ uirevision : 1
2131+ } ] )
2132+ . then ( function ( ) {
2133+ assertLevel ( 'no set level at start' , undefined ) ;
2134+ } )
2135+ . then ( function ( ) {
2136+ var nodeSeth = d3Select ( '.slice:nth-child(2)' ) . node ( ) ;
2137+ mouseEvent ( 'click' , 0 , 0 , { element : nodeSeth } ) ;
2138+ } )
2139+ . then ( function ( ) {
2140+ assertLevel ( 'after clicking on Seth sector' , 'Seth' ) ;
2141+ } )
2142+ . then ( function ( ) {
2143+ return Plotly . react ( gd , [ {
2144+ type : 'icicle' ,
2145+ labels : [ 'Eve' , 'Cain' , 'Seth' , 'Enos' , 'Noam' , 'Abel' , 'Awan' , 'Enoch' , 'Azura' , 'Joe' ] ,
2146+ parents : [ '' , 'Eve' , 'Eve' , 'Seth' , 'Seth' , 'Eve' , 'Eve' , 'Awan' , 'Eve' , 'Seth' ] ,
2147+ uirevision : 1
2148+ } ] ) ;
2149+ } )
2150+ . then ( function ( ) {
2151+ assertLevel ( 'after reacting with new data, but with same uirevision' , 'Seth' ) ;
2152+ } )
2153+ . then ( done , done . fail ) ;
2154+ } ) ;
21202155} ) ;
21212156
21222157describe ( 'Test Plotly.react + interactions under uirevision:' , function ( ) {
0 commit comments