Skip to content

Commit fcebdfc

Browse files
committed
Add jasmine test for fix that hover label should only include data from hovered category
1 parent 2f8ffa2 commit fcebdfc

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

test/jasmine/tests/hover_label_test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7436,6 +7436,38 @@ describe('hovermode: (x|y)unified', function () {
74367436
})
74377437
.then(done, done.fail);
74387438
});
7439+
7440+
fit('hover label should only show values of hovered category', function (done) {
7441+
Plotly.newPlot(gd, {
7442+
data: [
7443+
{ name: 'bar',
7444+
x: ['A', 'B'],
7445+
y: [1, 2],
7446+
type: 'bar'
7447+
},
7448+
{
7449+
name: 'scatter',
7450+
x: ['A', 'B'],
7451+
y: [10, null],
7452+
type: 'scatter'
7453+
}
7454+
],
7455+
layout: {
7456+
width: 400,
7457+
hovermode: 'x unified',
7458+
hoverdistance: 110
7459+
}
7460+
})
7461+
.then(function () {
7462+
_hover(gd, { xval: 1.1 });
7463+
assertLabel({ title: 'B', items: ['bar : 2'] });
7464+
})
7465+
.then(function () {
7466+
_hover(gd, { xval: 0 });
7467+
assertLabel({ title: 'A', items: ['bar : 1', 'scatter : 10'] });
7468+
})
7469+
.then(done, done.fail);
7470+
});
74397471
});
74407472

74417473
describe('hover on traces with (x|y)hoverformat', function () {

0 commit comments

Comments
 (0)