File tree 1 file changed +10
-11
lines changed
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() {
109
109
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( originalX , precision ) ;
110
110
expect ( gd . layout . yaxis . range ) . toBeCloseToArray ( originalY , precision ) ;
111
111
112
- setTimeout ( function ( ) {
112
+ delay ( MODEBAR_DELAY ) ( )
113
+ . then ( function ( ) {
113
114
114
115
expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 1 ) ;
115
116
relayoutCallback . calls . reset ( ) ;
@@ -167,16 +168,14 @@ describe('main plot pan', function() {
167
168
168
169
expect ( gd . layout . xaxis . range ) . toBeCloseToArray ( originalX , precision ) ;
169
170
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 ) ;
180
179
} ) ;
181
180
} ) ;
182
181
You can’t perform that action at this time.
0 commit comments