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

Skip to content

Commit 964a81d

Browse files
committed
destroy scenes after every gl plot tests
1 parent 2e63d1e commit 964a81d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/jasmine/tests/gl_plot_interact_test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,31 @@ var MOUSE_DELAY = 20;
2323
describe('Test gl plot interactions', function() {
2424
'use strict';
2525

26+
var gd;
27+
2628
beforeEach(function() {
2729
jasmine.addMatchers(customMatchers);
2830
});
2931

30-
afterEach(destroyGraphDiv);
32+
afterEach(function() {
33+
var fullLayout = gd._fullLayout,
34+
sceneIds;
35+
36+
sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d');
37+
sceneIds.forEach(function(id) {
38+
fullLayout[id]._scene.destroy();
39+
});
40+
41+
sceneIds = Plots.getSubplotIds(fullLayout, 'gl2d');
42+
sceneIds.forEach(function(id) {
43+
var scene2d = fullLayout._plots[id]._scene2d;
44+
scene2d.stopped = true;
45+
scene2d.destroy();
46+
});
47+
48+
destroyGraphDiv();
49+
});
50+
3151

3252
describe('gl3d plots', function() {
3353
var mock = require('@mocks/gl3d_marker-arrays.json');

0 commit comments

Comments
 (0)