Skip to content

Commit 2ccb815

Browse files
committed
reuse same graph div in test to ensure proper cleanup
1 parent 3881b91 commit 2ccb815

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/jasmine/tests/template_test.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,12 @@ describe('validateTemplate', function() {
286286
compareOutputs(out1, out2, expected, countToCheck);
287287

288288
// Test with DOM elements as argument
289-
var gd = createGraphDiv(), gdNotemplate = createGraphDiv();
289+
var gd = createGraphDiv();
290290
return Plotly.newPlot(gd, mock)
291-
.then(function() {return Plotly.newPlot(gdNotemplate, mockNoTemplate);})
292-
.then(function() {
293-
var out1 = Plotly.validateTemplate(gd);
294-
var out2 = Plotly.validateTemplate(gdNotemplate, template);
295-
compareOutputs(out1, out2, expected, countToCheck);
296-
})
291+
.then(function() {out1 = Plotly.validateTemplate(gd);})
292+
.then(function() {return Plotly.newPlot(gd, mockNoTemplate);})
293+
.then(function() {out2 = Plotly.validateTemplate(gd, template);})
294+
.then(function() {compareOutputs(out1, out2, expected, countToCheck);})
297295
.catch(failTest)
298296
.then(destroyGraphDiv);
299297
}

0 commit comments

Comments
 (0)