Skip to content

Commit d0c1ea7

Browse files
committed
add test
1 parent 630bcf8 commit d0c1ea7

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

test/jasmine/tests/modebar_test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff 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() {

0 commit comments

Comments
 (0)