@@ -7,6 +7,7 @@ var click = require('../assets/click');
7
7
var mouseEvent = require ( '../assets/mouse_event' ) ;
8
8
var failTest = require ( '../assets/fail_test' ) ;
9
9
var delay = require ( '../assets/delay' ) ;
10
+ var RESIZE_DELAY = 300 ;
10
11
11
12
describe ( 'config argument' , function ( ) {
12
13
@@ -585,7 +586,7 @@ describe('config argument', function() {
585
586
viewport . set ( width / 2 , height / 2 ) ;
586
587
587
588
return Promise . resolve ( )
588
- . then ( delay ( 200 ) )
589
+ . then ( delay ( RESIZE_DELAY ) )
589
590
. then ( function ( ) {
590
591
checkLayoutSize ( elWidth / 2 , elHeight / 2 ) ;
591
592
} )
@@ -639,7 +640,7 @@ describe('config argument', function() {
639
640
Plotly . plot ( gd , data , { } , { responsive : true } )
640
641
. then ( function ( ) { return Plotly . restyle ( gd , 'y[0]' , data [ 0 ] . y [ 0 ] + 2 ) ; } )
641
642
. then ( function ( ) { viewport . set ( width / 2 , width / 2 ) ; } )
642
- . then ( delay ( 200 ) )
643
+ . then ( delay ( RESIZE_DELAY ) )
643
644
// .then(function() {viewport.set(newWidth, 2 * newHeight);}).then(delay(200))
644
645
. then ( function ( ) {
645
646
expect ( cntWindowResize ) . toBe ( 1 ) ;
@@ -667,7 +668,7 @@ describe('config argument', function() {
667
668
// Resize viewport
668
669
. then ( function ( ) { viewport . set ( width / 2 , height / 2 ) ; } )
669
670
// Wait for resize to happen (Plotly.resize has an internal timeout)
670
- . then ( delay ( 200 ) )
671
+ . then ( delay ( RESIZE_DELAY ) )
671
672
// Check that final figure's size hasn't changed
672
673
. then ( function ( ) { checkLayoutSize ( width , height ) ; } )
673
674
. catch ( failTest )
0 commit comments