File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -861,13 +861,41 @@ describe('ModeBar', function() {
861861 } ) ;
862862
863863 describe ( 'button toggleSpikelines' , function ( ) {
864+ it ( 'should not change layout hovermode' , function ( ) {
865+ expect ( gd . _fullLayout . hovermode ) . toBe ( 'x' ) ;
866+ assertActive ( hovermodeButtons , buttonCompare ) ;
867+
868+ buttonToggle . click ( ) ;
869+ expect ( gd . _fullLayout . hovermode ) . toBe ( 'x' ) ;
870+ assertActive ( hovermodeButtons , buttonCompare ) ;
871+ } ) ;
864872 it ( 'should makes spikelines visible' , function ( ) {
865873 buttonToggle . click ( ) ;
866874 expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'on' ) ;
867875
868876 buttonToggle . click ( ) ;
869877 expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'off' ) ;
870878 } ) ;
879+ it ( 'should not become disabled when hovermode is switched off closest' , function ( ) {
880+ buttonToggle . click ( ) ;
881+ expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'on' ) ;
882+
883+ buttonCompare . click ( ) ;
884+ expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'on' ) ;
885+ } ) ;
886+ it ( 'should keep the state on changing the hovermode' , function ( ) {
887+ buttonToggle . click ( ) ;
888+ expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'on' ) ;
889+
890+ buttonCompare . click ( ) ;
891+ expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'on' ) ;
892+
893+ buttonToggle . click ( ) ;
894+ expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'off' ) ;
895+
896+ buttonClosest . click ( ) ;
897+ expect ( gd . _fullLayout . _cartesianSpikesEnabled ) . toBe ( 'off' ) ;
898+ } ) ;
871899 } ) ;
872900 } ) ;
873901
You can’t perform that action at this time.
0 commit comments