File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
test/jasmine/bundle_tests Expand file tree Collapse file tree 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');
55
66var createGraphDiv = require ( '../assets/create_graph_div' ) ;
77var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
8+ var failTest = require ( '../assets/fail_test' ) ;
9+
10+ var LONG_TIMEOUT_INTERVAL = 5 * jasmine . DEFAULT_TIMEOUT_INTERVAL ;
811
912
1013describe ( 'Bundle with choropleth' , function ( ) {
1114 'use strict' ;
1215
1316 Plotly . register ( PlotlyChoropleth ) ;
1417
18+ var gd ;
19+
1520 var mock = require ( '@mocks/geo_multiple-usa-choropleths.json' ) ;
1621
17- beforeEach ( function ( done ) {
18- Plotly . plot ( createGraphDiv ( ) , mock . data , mock . layout ) . then ( done ) ;
22+ beforeEach ( function ( ) {
23+ gd = createGraphDiv ( ) ;
1924 } ) ;
2025
2126 afterEach ( destroyGraphDiv ) ;
2227
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' ) ;
2532
26- expect ( nodes . size ( ) ) . toEqual ( 4 ) ;
27- } ) ;
33+ expect ( nodes . size ( ) ) . toEqual ( 4 ) ;
34+ } )
35+ . catch ( failTest )
36+ . then ( done ) ;
37+ } , LONG_TIMEOUT_INTERVAL ) ;
2838} ) ;
You can’t perform that action at this time.
0 commit comments