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

Skip to content

Commit 08917b5

Browse files
committed
splom test
1 parent 680d8bd commit 08917b5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

test/jasmine/tests/hover_label_test.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ var assertElemInside = customAssertions.assertElemInside;
2828

2929
var groupTitlesMock = require('../../image/mocks/legendgroup-titles');
3030

31+
var splomLogMock = require('../../image/mocks/splom_log');
32+
3133
function touch(path, options) {
3234
var len = path.length;
3335
Lib.clearThrottle();
@@ -2554,6 +2556,45 @@ describe('hover on subplots when hoversameaxis is set to true and y hovermodes',
25542556
});
25552557
});
25562558

2559+
describe('splom hover on subplots when hoversameaxis is set to true and (x|y) hovermodes', function() {
2560+
'use strict';
2561+
2562+
var mock = Lib.extendDeep({}, splomLogMock);
2563+
mock.layout.hovermode = 'x';
2564+
mock.layout.hoversameaxis = true;
2565+
2566+
var gd;
2567+
2568+
beforeEach(function(done) {
2569+
gd = createGraphDiv();
2570+
Plotly.newPlot(gd, mock).then(done);
2571+
});
2572+
2573+
afterEach(destroyGraphDiv);
2574+
2575+
it('splom hoversameaxis: true', function() {
2576+
Lib.clearThrottle();
2577+
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
2578+
expect(gd._hoverdata.length).toBe(3);
2579+
assertHoverLabelContent({
2580+
nums: ['100', '100k'],
2581+
name: ['', ''],
2582+
axis: '100'
2583+
});
2584+
2585+
Plotly.relayout(gd, 'hovermode', 'x unified');
2586+
2587+
Lib.clearThrottle();
2588+
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
2589+
expect(gd._hoverdata.length).toBe(3);
2590+
2591+
Plotly.relayout(gd, 'hovermode', 'y unified');
2592+
Lib.clearThrottle();
2593+
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
2594+
expect(gd._hoverdata.length).toBe(3);
2595+
});
2596+
});
2597+
25572598
describe('hover on many lines+bars', function() {
25582599
'use strict';
25592600

0 commit comments

Comments
 (0)