File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1619,6 +1619,31 @@ describe('ModeBar', function() {
16191619 . then ( done , done . fail ) ;
16201620 } ) ;
16211621
1622+ it ( 'changes hover icon colors' , function ( done ) {
1623+ Plotly . newPlot ( gd , [ ] , {
1624+ modebar : {
1625+ color : colors [ 0 ] ,
1626+ activecolor : colors [ 1 ]
1627+ }
1628+ } )
1629+ . then ( function ( ) {
1630+ button = selectButton ( gd . _fullLayout . _modeBar , targetBtn ) ;
1631+
1632+ // intentionally swap colors to verify hover handlers use the updated values
1633+ return Plotly . relayout ( gd , {
1634+ 'modebar.color' : colors [ 1 ] ,
1635+ 'modebar.activecolor' : colors [ 0 ]
1636+ } ) ;
1637+ } )
1638+ . then ( function ( ) {
1639+ button . node . dispatchEvent ( new window . MouseEvent ( 'mouseenter' ) ) ;
1640+ checkButtonColor ( button , colors [ 0 ] ) ;
1641+ button . node . dispatchEvent ( new window . MouseEvent ( 'mouseleave' ) ) ;
1642+ checkButtonColor ( button , colors [ 1 ] ) ;
1643+ } )
1644+ . then ( done , done . fail ) ;
1645+ } ) ;
1646+
16221647 it ( 'changes background color (displayModeBar: hover)' , function ( done ) {
16231648 Plotly . newPlot ( gd , [ ] , { modebar : { bgcolor : colors [ 0 ] } } )
16241649 . then ( function ( ) {
You can’t perform that action at this time.
0 commit comments