File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ describe('main plot pan', function() {
109109 expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( originalX , precision ) ;
110110 expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( originalY , precision ) ;
111111
112- setTimeout ( function ( ) {
112+ delay ( MODEBAR_DELAY ) ( )
113+ . then ( function ( ) {
113114
114115 expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 1 ) ;
115116 relayoutCallback . calls . reset ( ) ;
@@ -167,16 +168,14 @@ describe('main plot pan', function() {
167168
168169 expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( originalX , precision ) ;
169170 expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( originalY , precision ) ;
170-
171- setTimeout ( function ( ) {
172-
173- expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 6 ) ; // X and back; Y and back; XY and back
174-
175- done ( ) ;
176-
177- } , MODEBAR_DELAY ) ;
178-
179- } , MODEBAR_DELAY ) ;
171+ } )
172+ . then ( delay ( MODEBAR_DELAY ) )
173+ . then ( function ( ) {
174+ // X and back; Y and back; XY and back
175+ expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 6 ) ;
176+ } )
177+ . catch ( failTest )
178+ . then ( done ) ;
180179 } ) ;
181180} ) ;
182181
You can’t perform that action at this time.
0 commit comments