@@ -27,7 +27,9 @@ describe('zoom box element', function() {
2727 var mockCopy = Lib . extendDeep ( { } , mock ) ;
2828 mockCopy . layout . dragmode = 'zoom' ;
2929
30- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( done ) ;
30+ Plotly . plot ( gd , mockCopy . data , mockCopy . layout )
31+ . catch ( failTest )
32+ . then ( done ) ;
3133 } ) ;
3234
3335 afterEach ( destroyGraphDiv ) ;
@@ -74,9 +76,9 @@ describe('main plot pan', function() {
7476 relayoutCallback = jasmine . createSpy ( 'relayoutCallback' ) ;
7577
7678 gd . on ( 'plotly_relayout' , relayoutCallback ) ;
77-
78- done ( ) ;
79- } ) ;
79+ } )
80+ . catch ( failTest )
81+ . then ( done ) ;
8082 } ) ;
8183
8284 afterEach ( destroyGraphDiv ) ;
@@ -211,6 +213,7 @@ describe('axis zoom/pan and main plot zoom', function() {
211213 // each subplot is 200x200 px
212214 // if constrainScales is used, x/x2/y/y2 are linked, as are x3/y3
213215 // layoutEdits are other changes to make to the layout
216+
214217 var data = [
215218 { y : [ 0 , 1 , 2 ] } ,
216219 { y : [ 0 , 1 , 2 ] , xaxis : 'x2' } ,
@@ -242,9 +245,9 @@ describe('axis zoom/pan and main plot zoom', function() {
242245
243246 if ( layoutEdits ) Lib . extendDeep ( layout , layoutEdits ) ;
244247
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 ( ) {
248251 expect ( Object . keys ( gd . _fullLayout . _plots ) )
249252 . toEqual ( [ 'xy' , 'xy2' , 'x2y' , 'x3y3' ] ) ;
250253
@@ -278,6 +281,7 @@ describe('axis zoom/pan and main plot zoom', function() {
278281 function checkRanges ( newRanges , msg ) {
279282 msg = msg || '' ;
280283 if ( msg ) msg = ' - ' + msg ;
284+
281285 return function ( ) {
282286 var allRanges = {
283287 xaxis : initialRange . slice ( ) ,
0 commit comments