8000 adjust tests · plotly/plotly.js@71f75f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 71f75f5

Browse files
committed
adjust tests
1 parent 520dc80 commit 71f75f5

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

src/components/fx/hover.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ function _hover(gd, evt, subplot, noHoverEvent) {
669669
var insert = function(hd) {
670670
var type = hd.trace.type;
671671
var key = (
672+
type === 'box' ||
673+
type === 'violin' ||
672674
type === 'ohlc' ||
673675
type === 'candlestick'
674676
) ? hoverDataKey(hd) : hd.trace.index;

test/jasmine/tests/hover_label_test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -920,37 +920,37 @@ describe('hover info', function() {
920920
fontFamily: 'Arial',
921921
fontColor: 'rgb(0, 100, 200)'
922922
}, {
923-
bgcolor: 'rgb(255, 127, 14)',
923+
bgcolor: 'rgb(227, 119, 194)',
924924
bordercolor: 'rgb(68, 68, 68)',
925925
fontSize: 13,
926926
fontFamily: 'Arial',
927927
fontColor: 'rgb(68, 68, 68)'
928928
}, {
929-
bgcolor: 'rgb(0, 200, 0)',
929+
bgcolor: 'rgb(140, 86, 75)',
930930
bordercolor: 'rgb(255, 255, 255)',
931931
fontSize: 13,
932932
fontFamily: 'Arial',
933933
fontColor: 'rgb(255, 255, 255)'
934934
}, {
935-
bgcolor: 'rgb(150, 0, 0)',
935+
bgcolor: 'rgb(150, 0, 200)',
936936
bordercolor: 'rgb(255, 255, 255)',
937937
fontSize: 13,
938938
fontFamily: 'Arial',
939939
fontColor: 'rgb(255, 255, 255)'
940940
}, {
941-
bgcolor: 'rgb(150, 0, 200)',
941+
bgcolor: 'rgb(150, 0, 0)',
942942
bordercolor: 'rgb(255, 255, 255)',
943943
fontSize: 13,
944944
fontFamily: 'Arial',
945945
fontColor: 'rgb(255, 255, 255)'
946946
}, {
947-
bgcolor: 'rgb(140, 86, 75)',
947+
bgcolor: 'rgb(0, 200, 0)',
948948
bordercolor: 'rgb(255, 255, 255)',
949949
fontSize: 13,
950950
fontFamily: 'Arial',
951951
fontColor: 'rgb(255, 255, 255)'
952952
}, {
953-
bgcolor: 'rgb(227, 119, 194)',
953+
bgcolor: 'rgb(255, 127, 14)',
954954
bordercolor: 'rgb(68, 68, 68)',
955955
fontSize: 13,
956956
fontFamily: 'Arial',
@@ -2278,15 +2278,15 @@ describe('hover info on stacked subplots', function() {
22782278
y: 0
22792279
}));
22802280

2281-
expect(gd._hoverdata[1]).toEqual(jasmine.objectContaining(
2281+
expect(gd._hoverdata[2]).toEqual(jasmine.objectContaining(
22822282
{
22832283
curveNumber: 1,
22842284
pointNumber: 0,
22852285
x: 2.1,
22862286
y: 0
22872287
}));
22882288

2289-
expect(gd._hoverdata[2]).toEqual(jasmine.objectContaining(
2289+
expect(gd._hoverdata[1]).toEqual(jasmine.objectContaining(
22902290
{
22912291
curveNumber: 2,
22922292
pointNumber: 0,
@@ -5225,16 +5225,16 @@ describe('hovermode: (x|y)unified', function() {
52255225
]});
52265226

52275227
_hover(gd, { xpx: 100, ypx: 200 });
5228-
assertLabel({title: 'Jan 1, 2000', items: [
5229-
'bar : 1',
5230-
'start : (Jan, 1)'
5228+
assertLabel({title: 'Jan', items: [
5229+
'bar : (Jan 1, 2000, 1)',
5230+
'start : 1'
52315231
]});
52325232

52335233
_hover(gd, { xpx: 360, ypx: 200 });
5234-
assertLabel({title: 'Feb 1, 2000', items: [
5235-
'bar : 2',
5234+
assertLabel({title: 'Jan', items: [
5235+
'bar : (Feb 1, 2000, 2)',
52365236
'start : (Feb, 2)',
5237-
'end : (Jan, 1)'
5237+
'end : 1'
52385238
]});
52395239

52405240
_hover(gd, { xpx: 400, ypx: 200 });
@@ -5275,10 +5275,10 @@ describe('hovermode: (x|y)unified', function() {
52755275
.then(function(gd) {
52765276
_hover(gd, {curveNumber: 0});
52775277

5278-
assertLabel({title: 'Apr 13, 2014, 15:21:11', items: [
5278+
assertLabel({title: 'Apr 13, 2014, 15:21:15', items: [
52795279
'Outdoor (wun... : (Apr 13, 2014, 15:26:12, 69.4)',
5280-
'1st Floor (N... : (Apr 13, 2014, 15:21:15, 74.8)',
5281-
'2nd Floor (R... : 73.625',
5280+
'1st Floor (N... : 74.8',
5281+
'2nd Floor (R... : (Apr 13, 2014, 15:21:11, 73.625)',
52825282
'Attic (Ardui... : (Apr 13, 2014, 15:26:34, 98.49)'
52835283
]});
52845284
})

test/jasmine/tests/violin_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ describe('Test violin hover:', function() {
537537
name: ['', '', '', '', '', ''],
538538
axis: 'Sat',
539539
hoverLabelPos: [
540-
[364, 270], [352, 270], [339, 270],
541-
[346, 270], [349, 270], [387, 270]
540+
[364, 270], [387, 270], [339, 270],
541+
[346, 270], [349, 270], [352, 270]
542542
]
543543
}, {
544544
desc: 'single horizontal violin',

0 commit comments

Comments
 (0)
0