Kaynağa Gözat

Merge pull request #31 from ckeditor/i/6002

Tests: Fixed tests leaking editor instances / DOM elements. See ckeditor/ckeditor5#6002.
Kamil Piechaczek 6 yıl önce
ebeveyn
işleme
9b2ce286eb

+ 4 - 0
packages/ckeditor5-build-decoupled-document/tests/ckeditor.js

@@ -45,6 +45,8 @@ describe( 'DecoupledEditor build', () => {
 					expect( newEditor.ui.view.element ).to.be.null;
 					expect( newEditor.ui.view.toolbar.element.parentElement ).to.be.null;
 					expect( newEditor.ui.view.editable.element.parentElement ).to.be.null;
+
+					return newEditor.destroy();
 				} );
 		} );
 	} );
@@ -56,6 +58,8 @@ describe( 'DecoupledEditor build', () => {
 			return DecoupledEditor.create( editorElement )
 				.then( newEditor => {
 					expect( newEditor.ui.view.editable.element.parentElement ).to.equal( document.body );
+
+					return newEditor.destroy();
 				} );
 		} );
 	} );