瀏覽代碼

Tests: Moved the destroyEditorOrphans method from core to the watchdog package.

https://github.com/ckeditor/ckeditor5-core/pull/207/files#r363643104
Marek Lewandowski 6 年之前
父節點
當前提交
4d55639afb
共有 1 個文件被更改,包括 0 次插入18 次删除
  1. 0 18
      packages/ckeditor5-core/tests/_utils/cleanup.js

+ 0 - 18
packages/ckeditor5-core/tests/_utils/cleanup.js

@@ -17,21 +17,3 @@ export function removeEditorBodyOrphans() {
 		bodyOrphan.remove();
 	}
 }
-
-/**
- * Searches for orphaned editors based on DOM.
- *
- * This is useful if in your tests you have no access to editor, instance because editor
- * creation method doesn't complete in a graceful manner.
- */
-export function destroyEditorOrphans() {
-	const promises = [];
-
-	for ( const editableOrphan of document.querySelectorAll( '.ck-editor__editable' ) ) {
-		if ( editableOrphan.ckeditorInstance ) {
-			promises.push( editableOrphan.ckeditorInstance.destroy() );
-		}
-	}
-
-	return Promise.all( promises );
-}