Skip to content

Commit 8215169

Browse files
committed
add scattermapbox test for lines with trailing gaps
1 parent 63b33c3 commit 8215169

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/jasmine/tests/scattermapbox_test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,23 @@ describe('scattermapbox convert', function() {
365365
expect(actualText).toEqual(['A', 'B', 'C', 'F', '']);
366366
});
367367

368+
it('for lines traces with trailing gaps', function() {
369+
var opts = _convert(Lib.extendFlat({}, base, {
370+
mode: 'lines',
371+
lon: [10, '20', 30, 20, null, 20, 10, null],
372+
lat: [20, 20, '10', null, 10, 10, 20, null]
373+
}));
374+
375+
assertVisibility(opts, ['none', 'visible', 'none', 'none']);
376+
377+
var lineCoords = [
378+
[[10, 20], [20, 20], [30, 10]],
379+
[[20, 10], [10, 20]]
380+
];
381+
382+
expect(opts.line.geojson.coordinates).toEqual(lineCoords, 'have correct line coords');
383+
});
384+
368385
it('should correctly convert \'textposition\' to \'text-anchor\' and \'text-offset\'', function() {
369386
var specs = {
370387
'top left': ['top-right', [-0.65, -1.65]],

0 commit comments

Comments
 (0)