Skip to content

Commit 21fdedd

Browse files
committed
plotly#313 adding a test case for preexisting option "hoverinfo" : "none"
1 parent e24adca commit 21fdedd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/jasmine/tests/hover_label_test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,31 @@ describe('hover info', function() {
244244
});
245245
});
246246

247+
describe('hover info none', function() {
248+
var mockCopy = Lib.extendDeep({}, mock);
249+
250+
mockCopy.data[0].hoverinfo = 'none';
251+
252+
beforeEach(function(done) {
253+
Plotly.plot(createGraphDiv(), mockCopy.data, mockCopy.layout).then(done);
254+
});
255+
256+
it('does not render if hover is set to none', function() {
257+
var gd = document.getElementById('graph');
258+
Fx.hover('graph', evt, 'xy');
259+
260+
var hoverTrace = gd._hoverdata[0];
261+
262+
expect(hoverTrace.curveNumber).toEqual(0);
263+
expect(hoverTrace.pointNumber).toEqual(17);
264+
expect(hoverTrace.x).toEqual(0.388);
265+
expect(hoverTrace.y).toEqual(1);
266+
267+
expect(d3.selectAll('g.axistext').size()).toEqual(0);
268+
expect(d3.selectAll('g.hovertext').size()).toEqual(0);
269+
});
270+
});
271+
247272
describe('hoverformat', function() {
248273

249274
var data = [{

0 commit comments

Comments
 (0)