Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 848f4a5

Browse files
committed
move destroyGraphDiv to suite level
1 parent e7e0889 commit 848f4a5

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

test/jasmine/tests/plot_promise_test.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ var Events = require('@src/lib/events');
33
var createGraphDiv = require('../assets/create_graph_div');
44
var destroyGraphDiv = require('../assets/destroy_graph_div');
55

6+
67
describe('Plotly.___ methods', function() {
78
'use strict';
89

10+
afterEach(destroyGraphDiv);
11+
912
describe('Plotly.plot promise', function() {
1013
var promise,
1114
promiseGd;
@@ -20,7 +23,6 @@ describe('Plotly.___ methods', function() {
2023
done();
2124
});
2225
});
23-
afterEach(destroyGraphDiv);
2426

2527
it('should be returned with the graph div as an argument', function() {
2628
expect(promiseGd).toBeDefined();
@@ -54,7 +56,6 @@ describe('Plotly.___ methods', function() {
5456
});
5557
});
5658

57-
afterEach(destroyGraphDiv);
5859

5960
it('should be rejected when plotly_beforeplot event handlers return false', function() {
6061
expect(promiseRejected).toBe(true);
@@ -81,7 +82,6 @@ describe('Plotly.___ methods', function() {
8182
});
8283
});
8384

84-
afterEach(destroyGraphDiv);
8585

8686
it('should reject the promise when graph is being dragged', function() {
8787
expect(promiseRejected).toBe(true);
@@ -105,7 +105,6 @@ describe('Plotly.___ methods', function() {
105105
done();
106106
});
107107
});
108-
afterEach(destroyGraphDiv);
109108

110109
it('should be returned with the graph div as an argument', function() {
111110
expect(promiseGd).toBeDefined();
@@ -129,7 +128,6 @@ describe('Plotly.___ methods', function() {
129128
done();
130129
});
131130
});
132-
afterEach(destroyGraphDiv);
133131

134132
it('should be returned with the graph div as an argument', function() {
135133
expect(promiseGd).toBeDefined();
@@ -156,7 +154,6 @@ describe('Plotly.___ methods', function() {
156154
done();
157155
});
158156
});
159-
afterEach(destroyGraphDiv);
160157

161158
it('should be returned with the graph div as an argument', function() {
162159
expect(promiseGd).toBeDefined();
@@ -183,7 +180,6 @@ describe('Plotly.___ methods', function() {
183180
done();
184181
});
185182
});
186-
afterEach(destroyGraphDiv);
187183

188184
it('should be returned with the graph div as an argument', function() {
189185
expect(promiseGd).toBeDefined();
@@ -210,7 +206,6 @@ describe('Plotly.___ methods', function() {
210206
done();
211207
});
212208
});
213-
afterEach(destroyGraphDiv);
214209

215210
it('should be returned with the graph div as an argument', function() {
216211
expect(promiseGd).toBeDefined();
@@ -237,7 +232,6 @@ describe('Plotly.___ methods', function() {
237232
done();
238233
});
239234
});
240-
afterEach(destroyGraphDiv);
241235

242236
it('should be returned with the graph div as an argument', function() {
243237
expect(promiseGd).toBeDefined();
@@ -264,7 +258,6 @@ describe('Plotly.___ methods', function() {
264258
done();
265259
});
266260
});
267-
afterEach(destroyGraphDiv);
268261

269262
it('should be returned with the graph div as an argument', function() {
270263
expect(promiseGd).toBeDefined();
@@ -294,7 +287,6 @@ describe('Plotly.___ methods', function() {
294287
done();
295288
});
296289
});
297-
afterEach(destroyGraphDiv);
298290

299291
it('should be returned with the graph div as an argument', function() {
300292
expect(promiseGd).toBeDefined();
@@ -321,7 +313,6 @@ describe('Plotly.___ methods', function() {
321313
done();
322314
});
323315
});
324-
afterEach(destroyGraphDiv);
325316

326317
it('should be returned with the graph div as an argument', function() {
327318
expect(promiseGd).toBeDefined();
@@ -348,7 +339,6 @@ describe('Plotly.___ methods', function() {
348339
done();
349340
});
350341
});
351-
afterEach(destroyGraphDiv);
352342

353343
it('should be rejected when the attribute is missing', function() {
354344
expect(promiseRejected).toBe(true);
@@ -373,7 +363,6 @@ describe('Plotly.___ methods', function() {
373363
done();
374364
});
375365
});
376-
afterEach(destroyGraphDiv);
377366

378367
it('should be returned with the graph div as an argument', function() {
379368
expect(promiseGd).toBeDefined();
@@ -401,7 +390,6 @@ describe('Plotly.___ methods', function() {
401390
done();
402391
});
403392
});
404-
afterEach(destroyGraphDiv);
405393

406394
it('should be returned with the graph div as an argument', function() {
407395
expect(promiseGd).toBeDefined();
@@ -430,7 +418,6 @@ describe('Plotly.___ methods', function() {
430418
done();
431419
});
432420
});
433-
afterEach(destroyGraphDiv);
434421

435422
it('should be returned with the graph div unchanged when the framework is polar', function() {
436423
expect(promiseGd).toBeDefined();
@@ -457,7 +444,6 @@ describe('Plotly.___ methods', function() {
457444
done();
458445
});
459446
});
460-
afterEach(destroyGraphDiv);
461447

462448
it('should be rejected when the attribute is missing', function() {
463449
expect(promiseRejected).toBe(true);

0 commit comments

Comments
 (0)