-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathchoropleth_test.js
37 lines (24 loc) · 972 Bytes
/
choropleth_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
var d3SelectAll = require('../../strict-d3').selectAll;
var Plotly = require('../../../lib/core');
var PlotlyChoropleth = require('../../../lib/choropleth');
var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var LONG_TIMEOUT_INTERVAL = 5 * jasmine.DEFAULT_TIMEOUT_INTERVAL;
describe('Bundle with choropleth', function() {
'use strict';
Plotly.register(PlotlyChoropleth);
var gd;
var mock = require('../../image/mocks/geo_multiple-usa-choropleths.json');
beforeEach(function() {
gd = createGraphDiv();
});
afterEach(destroyGraphDiv);
it('should graph choropleth traces', function(done) {
Plotly.newPlot(gd, mock.data, mock.layout)
.then(function() {
var nodes = d3SelectAll('g.trace.choropleth');
expect(nodes.size()).toEqual(4);
})
.then(done, done.fail);
}, LONG_TIMEOUT_INTERVAL);
});