Merge pull request #8537 from Stacey-Gammon/reduce-test-memory-leaks

Reduce memory leaks in visualization tests
This commit is contained in:
Stacey Gammon 2016-10-05 08:33:21 -04:00 committed by GitHub
commit 07642cd04c
9 changed files with 12 additions and 19 deletions

View file

@ -13,8 +13,7 @@ import PersistedStatePersistedStateProvider from 'ui/persisted_state/persisted_s
describe('Vislib Dispatch Class Test Suite', function () {
function destroyVis(vis) {
$(vis.el).remove();
vis = null;
vis.destroy();
}
function getEls(el, n, type) {

View file

@ -42,8 +42,7 @@ dateHistogramArray.forEach(function (data, i) {
}));
afterEach(function () {
$(vis.el).remove();
vis = null;
vis.destroy();
});
describe('render Method', function () {

View file

@ -46,8 +46,7 @@ dateHistogramArray.forEach(function (data, i) {
});
afterEach(function () {
$(vis.el).remove();
vis = null;
vis.destroy();
});
describe('createLayout Method', function () {

View file

@ -42,9 +42,8 @@ dataArray.forEach(function (data, i) {
}));
afterEach(function () {
$(vis.el).remove();
$(secondVis.el).remove();
vis = null;
vis.destroy();
secondVis.destroy();
});
describe('render Method', function () {

View file

@ -38,8 +38,7 @@ _.forOwn(someOtherVariables, function (variablesAreCool, imaVariable) {
}));
afterEach(function () {
$(vis.el).remove();
vis = null;
vis.destroy();
});
describe('checkIfEnoughData method throws an error when not enough data', function () {

View file

@ -109,6 +109,7 @@ describe('Vislib _chart Test Suite', function () {
afterEach(function () {
el.remove();
vis.destroy();
});
it('should be a constructor for visualization modules', function () {

View file

@ -49,8 +49,7 @@ dataTypesArray.forEach(function (dataType, i) {
}));
afterEach(function () {
$(vis.el).remove();
vis = null;
vis.destroy();
});
describe('stackData method', function () {

View file

@ -49,8 +49,7 @@ describe('Vislib Line Chart', function () {
}));
afterEach(function () {
$(vis.el).remove();
vis = null;
vis.destroy();
});
describe('addCircleEvents method', function () {

View file

@ -110,8 +110,8 @@ describe('No global chart settings', function () {
}));
afterEach(function () {
chart1 = null;
chart2 = null;
chart1.destroy();
chart2.destroy();
});
it('should render chart titles for all charts', function () {
@ -192,8 +192,7 @@ aggArray.forEach(function (dataAgg, i) {
}));
afterEach(function () {
$(vis.el).remove();
vis = null;
vis.destroy();
});
describe('addPathEvents method', function () {