Skip to content

Commit bb13493

Browse files
committed
add jasmine test for hovertemplate for ohlc and candlestick traces
1 parent 237925d commit bb13493

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/jasmine/tests/finance_test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,5 +1298,37 @@ describe('finance trace hover via Fx.hover():', function () {
12981298
})
12991299
.then(done, done.fail);
13001300
});
1301+
1302+
it('should use hovertemplate (when provided) for ' + type, function (done) {
1303+
Plotly.newPlot(
1304+
gd,
1305+
[
1306+
{
1307+
x: [1, 2, 3],
1308+
open: [10, 20, 15],
1309+
high: [15, 25, 20],
1310+
low: [8, 18, 13],
1311+
close: [12, 22, 17],
1312+
type: type,
1313+
hovertemplate: 'O:%{open} H:%{high}<br>L:%{low} C:%{close}<extra></extra>'
1314+
}
1315+
],
1316+
{
1317+
xaxis: { rangeslider: { visible: false } },
1318+
width: 500,
1319+
height: 500
1320+
}
1321+
)
1322+
.then(function () {
1323+
hover(251, 178);
1324+
})
1325+
.then(function () {
1326+
assertHoverLabelContent({
1327+
nums: 'O:20 H:25\nL:18 C:22',
1328+
name: ''
1329+
});
1330+
})
1331+
.then(done, done.fail);
1332+
});
13011333
});
13021334
});

0 commit comments

Comments
 (0)