@@ -27,7 +27,10 @@ describe('Test removal of gl contexts', function() {
27
27
gd = createGraphDiv ( ) ;
28
28
} ) ;
29
29
30
- afterEach ( destroyGraphDiv ) ;
30
+ afterEach ( function ( ) {
31
+ Plotly . purge ( gd ) ;
32
+ destroyGraphDiv ( ) ;
33
+ } ) ;
31
34
32
35
it ( '@gl Plots.cleanPlot should remove gl context from the graph div of a gl2d plot' , function ( done ) {
33
36
Plotly . plot ( gd , [ {
@@ -41,6 +44,7 @@ describe('Test removal of gl contexts', function() {
41
44
42
45
expect ( ! ! gd . _fullLayout . _plots . xy . _scene ) . toBe ( false ) ;
43
46
} )
47
+ . catch ( failTest )
44
48
. then ( done ) ;
45
49
} ) ;
46
50
@@ -83,6 +87,7 @@ describe('Test removal of gl contexts', function() {
83
87
firstCanvas !== secondCanvas && firstGlContext . isContextLost ( )
84
88
) ;
85
89
} )
90
+ . catch ( failTest )
86
91
. then ( done ) ;
87
92
} ) ;
88
93
} ) ;
@@ -94,9 +99,10 @@ describe('Test gl plot side effects', function() {
94
99
gd = createGraphDiv ( ) ;
95
100
} ) ;
96
101
97
- afterEach ( function ( ) {
102
+ afterEach ( function ( done ) {
98
103
Plotly . purge ( gd ) ;
99
104
destroyGraphDiv ( ) ;
105
+ setTimeout ( done , 1000 ) ;
100
106
} ) ;
101
107
102
108
it ( '@gl should not draw the rangeslider' , function ( done ) {
@@ -118,6 +124,7 @@ describe('Test gl plot side effects', function() {
118
124
var rangeSlider = document . getElementsByClassName ( 'range-slider' ) [ 0 ] ;
119
125
expect ( rangeSlider ) . not . toBeDefined ( ) ;
120
126
} )
127
+ . catch ( failTest )
121
128
. then ( done ) ;
122
129
} ) ;
123
130
@@ -160,11 +167,12 @@ describe('Test gl plot side effects', function() {
160
167
161
168
return Plotly . purge ( gd ) ;
162
169
} )
170
+ . catch ( failTest )
163
171
. then ( done ) ;
164
172
} ) ;
165
173
166
174
it ( '@gl should be able to switch trace type' , function ( done ) {
167
- Plotly . newPlot ( gd , [ {
175
+ Plotly . plot ( gd , [ {
168
176
type : 'parcoords' ,
169
177
x : [ 1 , 2 , 3 ] ,
170
178
y : [ 2 , 1 , 2 ] ,
@@ -184,6 +192,7 @@ describe('Test gl plot side effects', function() {
184
192
. then ( function ( ) {
185
193
expect ( d3 . selectAll ( 'canvas' ) . size ( ) ) . toEqual ( 0 ) ;
186
194
} )
195
+ . catch ( failTest )
187
196
. then ( done ) ;
188
197
} ) ;
189
198
@@ -197,7 +206,7 @@ describe('Test gl plot side effects', function() {
197
206
. then ( function ( ) {
198
207
expect ( gd . querySelector ( '.gl-canvas-context' ) . width ) . toBe ( 600 ) ;
199
208
200
- Plotly . relayout ( gd , { width : 300 } ) ;
209
+ return Plotly . relayout ( gd , { width : 300 } ) ;
201
210
} )
202
211
. then ( function ( ) {
203
212
expect ( gd . querySelector ( '.gl-canvas-context' ) . width ) . toBe ( 300 ) ;
@@ -216,9 +225,10 @@ describe('Test gl2d plots', function() {
216
225
gd = createGraphDiv ( ) ;
217
226
} ) ;
218
227
219
- afterEach ( function ( ) {
228
+ afterEach ( function ( done ) {
220
229
Plotly . purge ( gd ) ;
221
230
destroyGraphDiv ( ) ;
231
+ setTimeout ( done , 1000 ) ;
222
232
} ) ;
223
233
224
234
function mouseTo ( p0 , p1 ) {
0 commit comments