From cef90d4123df530781ea8d110b1c03447a6f5f28 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Fri, 20 Dec 2019 15:28:29 +0100 Subject: [PATCH] Tests: Fixed tests leaking editor instance / DOM element. --- tests/dropdown/dropdownview.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/dropdown/dropdownview.js b/tests/dropdown/dropdownview.js index 68abd339..194e18fc 100644 --- a/tests/dropdown/dropdownview.js +++ b/tests/dropdown/dropdownview.js @@ -186,7 +186,7 @@ describe( 'DropdownView', () => { describe( 'render()', () => { it( 'starts listening for #keystrokes coming from #element', () => { - view = new DropdownView( locale, + const view = new DropdownView( locale, new ButtonView( locale ), new DropdownPanelView( locale ) ); @@ -195,10 +195,12 @@ describe( 'DropdownView', () => { view.render(); sinon.assert.calledOnce( spy ); sinon.assert.calledWithExactly( spy, view.element ); + + view.element.remove(); } ); it( 'adds #element to #focusTracker', () => { - view = new DropdownView( locale, + const view = new DropdownView( locale, new ButtonView( locale ), new DropdownPanelView( locale ) ); @@ -207,6 +209,8 @@ describe( 'DropdownView', () => { view.render(); sinon.assert.calledOnce( spy ); sinon.assert.calledWithExactly( spy, view.element ); + + view.element.remove(); } ); describe( 'activates keyboard navigation for the dropdown', () => {