@@ -3,9 +3,12 @@ var Events = require('@src/lib/events');
3
3
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
4
4
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
5
5
6
+
6
7
describe ( 'Plotly.___ methods' , function ( ) {
7
8
'use strict' ;
8
9
10
+ afterEach ( destroyGraphDiv ) ;
11
+
9
12
describe ( 'Plotly.plot promise' , function ( ) {
10
13
var promise ,
11
14
promiseGd ;
@@ -20,7 +23,6 @@ describe('Plotly.___ methods', function() {
20
23
done ( ) ;
21
24
} ) ;
22
25
} ) ;
23
- afterEach ( destroyGraphDiv ) ;
24
26
25
27
it ( 'should be returned with the graph div as an argument' , function ( ) {
26
28
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -54,7 +56,6 @@ describe('Plotly.___ methods', function() {
54
56
} ) ;
55
57
} ) ;
56
58
57
- afterEach ( destroyGraphDiv ) ;
58
59
59
60
it ( 'should be rejected when plotly_beforeplot event handlers return false' , function ( ) {
60
61
expect ( promiseRejected ) . toBe ( true ) ;
@@ -81,7 +82,6 @@ describe('Plotly.___ methods', function() {
81
82
} ) ;
82
83
} ) ;
83
84
84
- afterEach ( destroyGraphDiv ) ;
85
85
86
86
it ( 'should reject the promise when graph is being dragged' , function ( ) {
87
87
expect ( promiseRejected ) . toBe ( true ) ;
@@ -105,7 +105,6 @@ describe('Plotly.___ methods', function() {
105
105
done ( ) ;
106
106
} ) ;
107
107
} ) ;
108
- afterEach ( destroyGraphDiv ) ;
109
108
110
109
it ( 'should be returned with the graph div as an argument' , function ( ) {
111
110
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -129,7 +128,6 @@ describe('Plotly.___ methods', function() {
129
128
done ( ) ;
130
129
} ) ;
131
130
} ) ;
132
- afterEach ( destroyGraphDiv ) ;
133
131
134
132
it ( 'should be returned with the graph div as an argument' , function ( ) {
135
133
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -156,7 +154,6 @@ describe('Plotly.___ methods', function() {
156
154
done ( ) ;
157
155
} ) ;
158
156
} ) ;
159
- afterEach ( destroyGraphDiv ) ;
160
157
161
158
it ( 'should be returned with the graph div as an argument' , function ( ) {
162
159
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -183,7 +180,6 @@ describe('Plotly.___ methods', function() {
183
180
done ( ) ;
184
181
} ) ;
185
182
} ) ;
186
- afterEach ( destroyGraphDiv ) ;
187
183
188
184
it ( 'should be returned with the graph div as an argument' , function ( ) {
189
185
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -210,7 +206,6 @@ describe('Plotly.___ methods', function() {
210
206
done ( ) ;
211
207
} ) ;
212
208
} ) ;
213
- afterEach ( destroyGraphDiv ) ;
214
209
215
210
it ( 'should be returned with the graph div as an argument' , function ( ) {
216
211
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -237,7 +232,6 @@ describe('Plotly.___ methods', function() {
237
232
done ( ) ;
238
233
} ) ;
239
234
} ) ;
240
- afterEach ( destroyGraphDiv ) ;
241
235
242
236
it ( 'should be returned with the graph div as an argument' , function ( ) {
243
237
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -264,7 +258,6 @@ describe('Plotly.___ methods', function() {
264
258
done ( ) ;
265
259
} ) ;
266
260
} ) ;
267
- afterEach ( destroyGraphDiv ) ;
268
261
269
262
it ( 'should be returned with the graph div as an argument' , function ( ) {
270
263
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -294,7 +287,6 @@ describe('Plotly.___ methods', function() {
294
287
done ( ) ;
295
288
} ) ;
296
289
} ) ;
297
- afterEach ( destroyGraphDiv ) ;
298
290
299
291
it ( 'should be returned with the graph div as an argument' , function ( ) {
300
292
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -321,7 +313,6 @@ describe('Plotly.___ methods', function() {
321
313
done ( ) ;
322
314
} ) ;
323
315
} ) ;
324
- afterEach ( destroyGraphDiv ) ;
325
316
326
317
it ( 'should be returned with the graph div as an argument' , function ( ) {
327
318
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -348,7 +339,6 @@ describe('Plotly.___ methods', function() {
348
339
done ( ) ;
349
340
} ) ;
350
341
} ) ;
351
- afterEach ( destroyGraphDiv ) ;
352
342
353
343
it ( 'should be rejected when the attribute is missing' , function ( ) {
354
344
expect ( promiseRejected ) . toBe ( true ) ;
@@ -373,7 +363,6 @@ describe('Plotly.___ methods', function() {
373
363
done ( ) ;
374
364
} ) ;
375
365
} ) ;
376
- afterEach ( destroyGraphDiv ) ;
377
366
378
367
it ( 'should be returned with the graph div as an argument' , function ( ) {
379
368
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -401,7 +390,6 @@ describe('Plotly.___ methods', function() {
401
390
done ( ) ;
402
391
} ) ;
403
392
} ) ;
404
- afterEach ( destroyGraphDiv ) ;
405
393
406
394
it ( 'should be returned with the graph div as an argument' , function ( ) {
407
395
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -430,7 +418,6 @@ describe('Plotly.___ methods', function() {
430
418
done ( ) ;
431
419
} ) ;
432
420
} ) ;
433
- afterEach ( destroyGraphDiv ) ;
434
421
435
422
it ( 'should be returned with the graph div unchanged when the framework is polar' , function ( ) {
436
423
expect ( promiseGd ) . toBeDefined ( ) ;
@@ -457,7 +444,6 @@ describe('Plotly.___ methods', function() {
457
444
done ( ) ;
458
445
} ) ;
459
446
} ) ;
460
- afterEach ( destroyGraphDiv ) ;
461
447
462
448
it ( 'should be rejected when the attribute is missing' , function ( ) {
463
449
expect ( promiseRejected ) . toBe ( true ) ;
0 commit comments