mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Merge pull request #8551 from elastic/jasper/backport/8537/5.0
[backport] PR #8537 to 5.0 - Reduce memory leaks in visualization tests
This commit is contained in:
commit
2a1c86f67d
9 changed files with 12 additions and 19 deletions
|
@ -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) {
|
||||
|
|
|
@ -42,8 +42,7 @@ dateHistogramArray.forEach(function (data, i) {
|
|||
}));
|
||||
|
||||
afterEach(function () {
|
||||
$(vis.el).remove();
|
||||
vis = null;
|
||||
vis.destroy();
|
||||
});
|
||||
|
||||
describe('render Method', function () {
|
||||
|
|
|
@ -46,8 +46,7 @@ dateHistogramArray.forEach(function (data, i) {
|
|||
});
|
||||
|
||||
afterEach(function () {
|
||||
$(vis.el).remove();
|
||||
vis = null;
|
||||
vis.destroy();
|
||||
});
|
||||
|
||||
describe('createLayout Method', function () {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -49,8 +49,7 @@ dataTypesArray.forEach(function (dataType, i) {
|
|||
}));
|
||||
|
||||
afterEach(function () {
|
||||
$(vis.el).remove();
|
||||
vis = null;
|
||||
vis.destroy();
|
||||
});
|
||||
|
||||
describe('stackData method', function () {
|
||||
|
|
|
@ -49,8 +49,7 @@ describe('Vislib Line Chart', function () {
|
|||
}));
|
||||
|
||||
afterEach(function () {
|
||||
$(vis.el).remove();
|
||||
vis = null;
|
||||
vis.destroy();
|
||||
});
|
||||
|
||||
describe('addCircleEvents method', function () {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue