@@ -1361,6 +1361,7 @@ describe('bar visibility toggling:', function() {
13611361 spyOn ( gd . _fullData [ 0 ] . _module , 'crossTraceCalc' ) . and . callThrough ( ) ;
13621362
13631363 _assert ( 'base' , [ 0.5 , 3.5 ] , [ - 2.222 , 2.222 ] , 0 ) ;
1364+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'normal' ) ;
13641365 return Plotly . restyle ( gd , 'visible' , false , [ 1 ] ) ;
13651366 } )
13661367 . then ( function ( ) {
@@ -1369,6 +1370,11 @@ describe('bar visibility toggling:', function() {
13691370 } )
13701371 . then ( function ( ) {
13711372 _assert ( 'both invisible' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1373+ return Plotly . restyle ( gd , 'visible' , 'legendonly' ) ;
1374+ } )
1375+ . then ( function ( ) {
1376+ _assert ( 'both legendonly' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1377+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'normal' ) ;
13721378 return Plotly . restyle ( gd , 'visible' , true , [ 1 ] ) ;
13731379 } )
13741380 . then ( function ( ) {
@@ -1391,6 +1397,7 @@ describe('bar visibility toggling:', function() {
13911397 spyOn ( gd . _fullData [ 0 ] . _module , 'crossTraceCalc' ) . and . callThrough ( ) ;
13921398
13931399 _assert ( 'base' , [ 0.5 , 3.5 ] , [ 0 , 5.263 ] , 0 ) ;
1400+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'reversed' ) ;
13941401 return Plotly . restyle ( gd , 'visible' , false , [ 1 ] ) ;
13951402 } )
13961403 . then ( function ( ) {
@@ -1399,6 +1406,11 @@ describe('bar visibility toggling:', function() {
13991406 } )
14001407 . then ( function ( ) {
14011408 _assert ( 'both invisible' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1409+ return Plotly . restyle ( gd , 'visible' , 'legendonly' ) ;
1410+ } )
1411+ . then ( function ( ) {
1412+ _assert ( 'both legendonly' , [ 0.5 , 3.5 ] , [ 0 , 2.105 ] , 0 ) ;
1413+ expect ( gd . _fullLayout . legend . traceorder ) . toBe ( 'reversed' ) ;
14021414 return Plotly . restyle ( gd , 'visible' , true , [ 1 ] ) ;
14031415 } )
14041416 . then ( function ( ) {
0 commit comments