-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathcore_test.js
40 lines (28 loc) · 1.11 KB
/
core_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var d3 = require('@plotly/d3');
var Plotly = require('@lib/core');
var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
describe('Bundle with core only', function() {
'use strict';
var gd;
var mock = require('@mocks/bar_line.json');
beforeEach(function(done) {
gd = createGraphDiv();
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
});
afterEach(destroyGraphDiv);
it('should graph scatter traces', function() {
var nodes = d3.selectAll('g.trace.scatter');
expect(nodes.size()).toEqual(mock.data.length);
});
it('should not graph bar traces', function() {
var nodes = d3.selectAll('g.trace.bars');
expect(nodes.size()).toEqual(0);
});
it('should not have calendar attributes', function() {
// calendars is a register-able component that we have not registered
expect(gd._fullLayout.calendar).toBeUndefined();
expect(gd._fullLayout.xaxis.calendar).toBeUndefined();
expect(gd._fullData[0].xcalendar).toBeUndefined();
});
});