@@ -27,7 +27,9 @@ describe('zoom box element', function() {
27
27
var mockCopy = Lib . extendDeep ( { } , mock ) ;
28
28
mockCopy . layout . dragmode = 'zoom' ;
29
29
30
- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( done ) ;
30
+ Plotly . plot ( gd , mockCopy . data , mockCopy . layout )
31
+ . catch ( failTest )
32
+ . then ( done ) ;
31
33
} ) ;
32
34
33
35
afterEach ( destroyGraphDiv ) ;
@@ -74,9 +76,9 @@ describe('main plot pan', function() {
74
76
relayoutCallback = jasmine . createSpy ( 'relayoutCallback' ) ;
75
77
76
78
gd . on ( 'plotly_relayout' , relayoutCallback ) ;
77
-
78
- done ( ) ;
79
- } ) ;
79
+ } )
80
+ . catch ( failTest )
81
+ . then ( done ) ;
80
82
} ) ;
81
83
82
84
afterEach ( destroyGraphDiv ) ;
@@ -211,6 +213,7 @@ describe('axis zoom/pan and main plot zoom', function() {
211
213
// each subplot is 200x200 px
212
214
// if constrainScales is used, x/x2/y/y2 are linked, as are x3/y3
213
215
// layoutEdits are other changes to make to the layout
216
+
214
217
var data = [
215
218
{ y : [ 0 , 1 , 2 ] } ,
216
219
{ y : [ 0 , 1 , 2 ] , xaxis : 'x2' } ,
@@ -242,9 +245,9 @@ describe('axis zoom/pan and main plot zoom', function() {
242
245
243
246
if ( layoutEdits ) Lib . extendDeep ( layout , layoutEdits ) ;
244
247
245
- return Plotly . newPlot ( gd , data , layout , config ) . then ( function ( ) {
246
- checkRanges ( { } , 'initial' ) ;
247
-
248
+ return Plotly . newPlot ( gd , data , layout , config )
249
+ . then ( checkRanges ( { } , 'initial' ) )
250
+ . then ( function ( ) {
248
251
expect ( Object . keys ( gd . _fullLayout . _plots ) )
249
252
. toEqual ( [ 'xy' , 'xy2' , 'x2y' , 'x3y3' ] ) ;
250
253
@@ -278,6 +281,7 @@ describe('axis zoom/pan and main plot zoom', function() {
278
281
function checkRanges ( newRanges , msg ) {
279
282
msg = msg || '' ;
280
283
if ( msg ) msg = ' - ' + msg ;
284
+
281
285
return function ( ) {
282
286
var allRanges = {
283
287
xaxis : initialRange . slice ( ) ,
0 commit comments