8000 #313 populate searchdata even if hoverinfo === 'none' by monfera · Pull Request #2 · monfera/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

#313 populate searchdata even if hoverinfo === 'none' #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
plotly#313 adding a test case for the 'plotly_hover' callback for the…
… preexisting option "hoverinfo" : "none"
  • Loading branch information
monfera committed Apr 17, 2016
commit aa55b138f1255c20ee110233be62d96d0309a53c
32 changes: 32 additions & 0 deletions test/jasmine/tests/click_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,38 @@ describe('click interactions', function() {
});
});

describe('click events with hoverinfo set to none', function() {
var futureData;

beforeEach(function(done) {
gd = createGraphDiv();

var mockCopy = Lib.extendDeep({}, mock);
mockCopy.data[0].hoverinfo = 'none';
Plotly.plot(gd, mockCopy.data, mockCopy.layout)
.then(done);

gd.on('plotly_hover', function(data) {
futureData = data;
});
});

it('should contain the correct fields despite hoverinfo: "none"', function() {
click(pointPos[0], pointPos[1]);
expect(futureData.points.length).toEqual(1);

var pt = futureData.points[0];
expect(Object.keys(pt)).toEqual([
'data', 'fullData', 'curveNumber', 'pointNumber',
'x', 'y', 'xaxis', 'yaxis'
]);
expect(pt.curveNumber).toEqual(0);
expect(pt.pointNumber).toEqual(11);
expect(pt.x).toEqual(0.125);
expect(pt.y).toEqual(2.125);
});
});

describe('double click events', function() {
var futureData;

Expand Down
0