Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39c9013

Browse files
committed
test unified hover including points in other plots
1 parent 4f13620 commit 39c9013

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

test/jasmine/tests/hover_label_test.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ describe('hover info on stacked subplots', function() {
23782378
});
23792379
});
23802380

2381-
describe('hover on subplots when hoversameaxis is set to true and x hovermode', function() {
2381+
describe('hover on subplots when hoversameaxis is set to true and x hovermodes', function() {
23822382
'use strict';
23832383

23842384
var mock = {
@@ -2421,7 +2421,7 @@ describe('hover on subplots when hoversameaxis is set to true and x hovermode',
24212421

24222422
afterEach(destroyGraphDiv);
24232423

2424-
it('hovermode: x with hoversameaxis: true', function() {
2424+
it('hovermode: *x* | *x unified* with hoversameaxis: true', function() {
24252425
var pos = 0;
24262426
var subplot = 'xy';
24272427
Lib.clearThrottle();
@@ -2456,10 +2456,17 @@ describe('hover on subplots when hoversameaxis is set to true and x hovermode',
24562456
name: ['trace 0', 'trace 1', 'trace 2'],
24572457
axis: String(pos)
24582458
});
2459+
2460+
Plotly.relayout(gd, 'hovermode', 'x unified');
2461+
pos = 0;
2462+
subplot = 'xy';
2463+
Lib.clearThrottle();
2464+
Plotly.Fx.hover(gd, {xval: pos}, subplot);
2465+
expect(gd._hoverdata.length).toBe(3);
24592466
});
24602467
});
24612468

2462-
describe('hover on subplots when hoversameaxis is set to true and y hovermode', function() {
2469+
describe('hover on subplots when hoversameaxis is set to true and y hovermodes', function() {
24632470
'use strict';
24642471

24652472
var mock = {
@@ -2502,7 +2509,7 @@ describe('hover on subplots when hoversameaxis is set to true and y hovermode',
25022509

25032510
afterEach(destroyGraphDiv);
25042511

2505-
it('hovermode: y with hoversameaxis: true', function() {
2512+
it('hovermode: *y* | *y unified* with hoversameaxis: true', function() {
25062513
var pos = 0;
25072514
var subplot = 'xy';
25082515
Lib.clearThrottle();
@@ -2537,6 +2544,13 @@ describe('hover on subplots when hoversameaxis is set to true and y hovermode',
25372544
name: ['trace 0', 'trace 1', 'trace 2'],
25382545
axis: String(pos)
25392546
});
2547+
2548+
Plotly.relayout(gd, 'hovermode', 'y unified');
2549+
pos = 0;
2550+
subplot = 'xy';
2551+
Lib.clearThrottle();
2552+
Plotly.Fx.hover(gd, {yval: pos}, subplot);
2553+
expect(gd._hoverdata.length).toBe(3);
25402554
});
25412555
});
25422556

0 commit comments

Comments
 (0)