8000 Add test for connectgaps · tulip/plotly.js@b5309ec · GitHub
[go: up one dir, main page]

Skip to content 8000
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit b5309ec

Browse files
committed
Add test for connectgaps
1 parent 7b0036e commit b5309ec

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/jasmine/tests/calcdata_test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var Plotly = require('@lib/index');
2+
3+
var createGraphDiv = require('../assets/create_graph_div');
4+
var destroyGraphDiv = require('../assets/destroy_graph_div');
5+
6+
fdescribe('calculated data and points', function() {
7+
describe('connectGaps', function() {
8+
9+
var gd;
10+
11+
beforeEach(function() {
12+
gd = createGraphDiv();
13+
});
14+
15+
afterEach(destroyGraphDiv);
16+
17+
it('should exclude null and undefined points when false', function() {
18+
Plotly.plot(gd, [{ x: [1,2,3,undefined,5], y: [1,null,3,4,5]}], {});
19+
20+
expect(gd.calcdata[0][1]).toEqual({ x: false, y: false});
21+
expect(gd.calcdata[0][3]).toEqual({ x: false, y: false});
22+
});
23+
24+
it('should exclude null and undefined points as categories when false', function() {
25+
Plotly.plot(gd, [{ x: [1,2,3,undefined,5], y: [1,null,3,4,5] }], { xaxis: { type: 'category' }});
26+
27+
expect(gd.calcdata[0][1]).toEqual({ x: false, y: false});
28+
expect(gd.calcdata[0][3]).toEqual({ x: false, y: false});
29+
});
30+
});
31+
});

0 commit comments

Comments
 (0)
0