Skip to content

Commit 1c651e8

Browse files
committed
toimage_test: make sure that all graph divs are deleted
1 parent 0b62e45 commit 1c651e8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

test/jasmine/tests/toimage_test.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@
22
// once established and confirmed?
33

44
var Plotly = require('@lib/index');
5+
6+
var d3 = require('d3');
57
var createGraphDiv = require('../assets/create_graph_div');
6-
var destroyGraphDiv = require('../assets/destroy_graph_div');
78
var subplotMock = require('@mocks/multiple_subplots.json');
89

910

1011
describe('Plotly.toImage', function() {
1112
'use strict';
13+
1214
var gd;
1315

1416
beforeEach(function() {
1517
gd = createGraphDiv();
1618
});
1719

18-
afterEach(destroyGraphDiv);
20+
afterEach(function() {
21+
22+
// make sure ALL graph divs are deleted,
23+
// even the ones generated by Plotly.toImage
24+
d3.selectAll('.js-plotly-plot').remove();
25+
});
1926

2027
it('should be attached to Plotly', function() {
2128
expect(Plotly.toImage).toBeDefined();

test/jasmine/tests/transforms_test.js

+1
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ describe('multiple traces with transforms:', function() {
776776

777777
function assertDims(dims) {
778778
var traces = d3.selectAll('.trace');
779+
779780
expect(traces.size())
780781
.toEqual(dims.length, 'to have correct number of traces');
781782

0 commit comments

Comments
 (0)