Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7427284

Browse filesBrowse files
committed
PR feedback: hover tooltip tests; switching to addTraces
1 parent aa83612 commit 7427284
Copy full SHA for 7427284

File tree

1 file changed

+29
-1
lines changed
Filter options

1 file changed

+29
-1
lines changed

‎test/jasmine/tests/sankey_test.js

Copy file name to clipboardExpand all lines: test/jasmine/tests/sankey_test.js
+29-1Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var Sankey = require('@src/traces/sankey');
99

1010
var createGraphDiv = require('../assets/create_graph_div');
1111
var destroyGraphDiv = require('../assets/destroy_graph_div');
12+
var mouseEvent = require('../assets/mouse_event');
1213

1314
describe('sankey tests', function() {
1415

@@ -269,7 +270,7 @@ describe('sankey tests', function() {
269270
.then(function() {
270271
expect(gd.data.length).toEqual(1);
271272
expect(d3.selectAll('.sankey').size()).toEqual(1);
272-
return Plotly.plot(gd, mockCopy2);
273+
return Plotly.addTraces(gd, mockCopy2.data[0]);
273274
})
274275
.then(function() {
275276
expect(gd.data.length).toEqual(2);
@@ -310,5 +311,32 @@ describe('sankey tests', function() {
310311
done();
311312
});
312313
});
314+
315+
it('Plotly.plot shows and removes tooltip on node, link', function(done) {
316+
317+
var gd = createGraphDiv();
318+
var mockCopy = Lib.extendDeep({}, mock);
319+
320+
Plotly.plot(gd, mockCopy)
321+
.then(function() {
322+
323+
mouseEvent('mousemove', 400, 300);
324+
mouseEvent('mouseover', 400, 300);
325+
326+
window.setTimeout(function() {
327+
expect(d3.select('.hoverlayer>.hovertext>text').node().innerHTML)
328+
.toEqual('447TWh', 'tooltip present');
329+
330+
mouseEvent('mousemove', 450, 300);
331+
mouseEvent('mouseover', 450, 300);
332+
333+
window.setTimeout(function() {
334+
expect(d3.select('.hoverlayer>.hovertext>text').node().innerHTML)
335+
.toEqual('46TWh', 'tooltip jumped to link');
336+
done();
337+
}, 60);
338+
}, 60);
339+
});
340+
});
313341
});
314342
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.