Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Tests: Fixed tests leaking editor instance / DOM element.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Dec 20, 2019
1 parent b7e2bfe commit 1e8f90a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/view/observer/focusobserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ describe( 'FocusObserver', () => {
observer = view.getObserver( FocusObserver );
} );

afterEach( () => {
view.destroy();
domRoot.remove();
} );

it( 'should always render document after selectionChange event', done => {
const selectionChangeSpy = sinon.spy();
const renderSpy = sinon.spy();
Expand Down
7 changes: 7 additions & 0 deletions tests/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,8 @@ describe( 'Renderer', () => {
container = document.getSelection().anchorNode;

expect( domEditable.contains( container ) ).to.be.true;

domEditable.remove();
} );

it( 'should bind fake selection container to view selection', () => {
Expand Down Expand Up @@ -3721,6 +3723,11 @@ describe( 'Renderer', () => {
converter = view.domConverter;
} );

afterEach( () => {
view.destroy();
domRoot.remove();
} );

it( 'should properly render unwrapped attributes #1', () => {
setViewData( view,
'<container:p>' +
Expand Down

0 comments on commit 1e8f90a

Please sign in to comment.