Skip to content

Commit 8d185b9

Browse files
committed
add jasmine test
1 parent 8118644 commit 8d185b9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/jasmine/tests/waterfall_test.js

+31
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,37 @@ describe('waterfall hover', function() {
15281528
.then(done, done.fail);
15291529
});
15301530

1531+
it('should provide delta hovertemplate on totals similar to hovertext', function(done) {
1532+
gd = createGraphDiv();
1533+
1534+
function _hover() {
1535+
var evt = { xpx: 400, ypx: 100 };
1536+
Fx.hover('graph', evt, 'xy');
1537+
}
1538+
1539+
Plotly.newPlot(gd, {
1540+
data: [{
1541+
type: 'waterfall',
1542+
y: [ 10, -4, null ],
1543+
measure: [ '', '', 'total' ],
1544+
texttemplate: '%{delta}',
1545+
hovertemplate: '%{delta}',
1546+
}],
1547+
layout: {
1548+
width: 600,
1549+
height: 400
1550+
}
1551+
})
1552+
.then(_hover)
1553+
.then(function() {
1554+
assertHoverLabelContent({
1555+
nums: '6',
1556+
name: 'trace 0'
1557+
});
1558+
})
1559+
.then(done, done.fail);
1560+
});
1561+
15311562
it('should format numbers - round hover precision', function(done) {
15321563
gd = createGraphDiv();
15331564

0 commit comments

Comments
 (0)