File tree 1 file changed +16
-6
lines changed
test/jasmine/bundle_tests
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -5,24 +5,34 @@ var PlotlyChoropleth = require('@lib/choropleth');
5
5
6
6
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
7
7
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
8
+ var failTest = require ( '../assets/fail_test' ) ;
9
+
10
+ var LONG_TIMEOUT_INTERVAL = 5 * jasmine . DEFAULT_TIMEOUT_INTERVAL ;
8
11
9
12
10
13
describe ( 'Bundle with choropleth' , function ( ) {
11
14
'use strict' ;
12
15
13
16
Plotly . register ( PlotlyChoropleth ) ;
14
17
18
+ var gd ;
19
+
15
20
var mock = require ( '@mocks/geo_multiple-usa-choropleths.json' ) ;
16
21
17
- beforeEach ( function ( done ) {
18
- Plotly . plot ( createGraphDiv ( ) , mock . data , mock . layout ) . then ( done ) ;
22
+ beforeEach ( function ( ) {
23
+ gd = createGraphDiv ( ) ;
19
24
} ) ;
20
25
21
26
afterEach ( destroyGraphDiv ) ;
22
27
23
- it ( 'should graph choropleth traces' , function ( ) {
24
- var nodes = d3 . selectAll ( 'g.trace.choropleth' ) ;
28
+ it ( 'should graph choropleth traces' , function ( done ) {
29
+ Plotly . plot ( gd , mock . data , mock . layout )
30
+ . then ( function ( ) {
31
+ var nodes = d3 . selectAll ( 'g.trace.choropleth' ) ;
25
32
26
- expect ( nodes . size ( ) ) . toEqual ( 4 ) ;
27
- } ) ;
33
+ expect ( nodes . size ( ) ) . toEqual ( 4 ) ;
34
+ } )
35
+ . catch ( failTest )
36
+ . then ( done ) ;
37
+ } , LONG_TIMEOUT_INTERVAL ) ;
28
38
} ) ;
You can’t perform that action at this time.
0 commit comments