From f551317b5dcee7993cbfd9b26144a5aac1b6e10f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 21 Apr 2016 13:41:25 +0100 Subject: [PATCH] Unmount TimelinePanel when test completes ... mostly because it seems like a nice idea. --- test/components/structures/TimelinePanel-test.js | 3 ++- test/test-utils.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/components/structures/TimelinePanel-test.js b/test/components/structures/TimelinePanel-test.js index 671d5c7774..d314e7db94 100644 --- a/test/components/structures/TimelinePanel-test.js +++ b/test/components/structures/TimelinePanel-test.js @@ -76,7 +76,8 @@ describe('TimelinePanel', function() { afterEach(function() { if (parentDiv) { - document.body.removeChild(parentDiv); + ReactDOM.unmountComponentAtNode(parentDiv); + parentDiv.remove(); parentDiv = null; } sandbox.restore(); diff --git a/test/test-utils.js b/test/test-utils.js index a077722678..d2e40e0ee0 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -37,6 +37,7 @@ module.exports.stubClient = function() { getRoom: sinon.stub(), loginFlows: sinon.stub(), on: sinon.stub(), + removeListener: sinon.stub(), paginateEventTimeline: sinon.stub().returns(q()), sendReadReceipt: sinon.stub().returns(q()),