Skip to content

Commit 5164cdf

Browse files
committed
add test for no spikelines on scatter fills
1 parent d34ba81 commit 5164cdf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/jasmine/tests/hover_spikeline_test.js

+20
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,24 @@ describe('spikeline hover', function() {
459459
.catch(fail)
460460
.then(done);
461461
});
462+
463+
it('does not show spikes on scatter fills', function(done) {
464+
Plotly.newPlot(gd, [{
465+
x: [0, 0, 1, 1, 0], y: [0, 2, 2, 0, 0], fill: 'toself'
466+
}], Lib.extendFlat({}, spikeLayout(), {hovermode: 'closest'}))
467+
.then(function() {
468+
// center of the fill: no spikes
469+
_hover({xval: 0.5, yval: 1});
470+
_assert([], []);
471+
472+
// sanity check: points still generate spikes
473+
_hover({xval: 0, yval: 0});
474+
_assert(
475+
[[200, 500, 200, 400], [100, 400, 200, 400]],
476+
[[200, 500], [100, 400]]
477+
);
478+
})
479+
.catch(fail)
480+
.then(done);
481+
});
462482
});

0 commit comments

Comments
 (0)