Skip to content

Commit 45f06c4

Browse files
committed
sankey test that labels are not shown when hovermode is false
1 parent edc20b0 commit 45f06c4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/jasmine/tests/sankey_test.js

+27
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,28 @@ describe('sankey tests', function() {
482482
.catch(failTest)
483483
.then(done);
484484
});
485+
486+
it('should not show labels if hovermode is false', function(done) {
487+
var gd = createGraphDiv();
488+
var mockCopy = Lib.extendDeep({}, mock);
489+
490+
function _hover(px, py) {
491+
mouseEvent('mousemove', px, py);
492+
mouseEvent('mouseover', px, py);
493+
Lib.clearThrottle();
494+
}
495+
496+
Plotly.plot(gd, mockCopy).then(function() {
497+
return Plotly.relayout(gd, 'hovermode', false);
498+
})
499+
.then(function() {
500+
_hover(404, 302);
501+
502+
assertNoLabel();
503+
})
504+
.catch(failTest)
505+
.then(done);
506+
});
485507
});
486508

487509
describe('Test hover/click event data:', function() {
@@ -620,3 +642,8 @@ function assertLabel(content, style) {
620642
fontColor: style[4]
621643
});
622644
}
645+
646+
function assertNoLabel() {
647+
var g = d3.selectAll('.hovertext');
648+
expect(g[0].length).toBe(0);
649+
}

0 commit comments

Comments
 (0)