@@ -3,10 +3,11 @@ var createGraphDiv = require('../assets/create_graph_div');
3
3
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
4
4
var textchartMock = require ( '@mocks/text_chart_arrays.json' ) ;
5
5
6
+ var LONG_TIMEOUT_INTERVAL = 2 * jasmine . DEFAULT_TIMEOUT_INTERVAL ;
7
+
6
8
describe ( 'Plotly.downloadImage' , function ( ) {
7
9
'use strict' ;
8
10
var gd ;
9
- var originalTimeout ;
10
11
11
12
// override click handler on createElement
12
13
// so these tests will not actually
@@ -27,16 +28,10 @@ describe('Plotly.downloadImage', function() {
27
28
28
29
beforeEach ( function ( ) {
29
30
gd = createGraphDiv ( ) ;
30
-
31
- // downloadImage can take a little longer
32
- // so give it a little more time to finish
33
- originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
34
- jasmine . DEFAULT_TIMEOUT_INTERVAL = 10000 ;
35
31
} ) ;
36
32
37
33
afterEach ( function ( ) {
38
34
destroyGraphDiv ( ) ;
39
- jasmine . DEFAULT_TIMEOUT_INTERVAL = originalTimeout ;
40
35
} ) ;
41
36
42
37
it ( 'should be attached to Plotly' , function ( ) {
@@ -45,11 +40,11 @@ describe('Plotly.downloadImage', function() {
45
40
46
41
it ( 'should create link, remove link, accept options' , function ( done ) {
47
42
downloadTest ( gd , 'jpeg' , done ) ;
48
- } ) ;
43
+ } , LONG_TIMEOUT_INTERVAL ) ;
49
44
50
45
it ( 'should create link, remove link, accept options' , function ( done ) {
51
46
downloadTest ( gd , 'png' , done ) ;
52
- } ) ;
47
+ } , LONG_TIMEOUT_INTERVAL ) ;
53
48
54
49
it ( 'should create link, remove link, accept options' , function ( done ) {
55
50
checkWebp ( function ( supported ) {
@@ -59,12 +54,11 @@ describe('Plotly.downloadImage', function() {
59
54
done ( ) ;
60
55
}
61
56
} ) ;
62
-
63
- } ) ;
57
+ } , LONG_TIMEOUT_INTERVAL ) ;
64
58
65
59
it ( 'should create link, remove link, accept options' , function ( done ) {
66
60
downloadTest ( gd , 'svg' , done ) ;
67
- } ) ;
61
+ } , LONG_TIMEOUT_INTERVAL ) ;
68
62
} ) ;
69
63
70
64
0 commit comments