Explorar el Código

Tests: Fixed the cleanup util test leaking itself by not using it(). Also: reverted stupid it.only() change.

Piotrek Koszuliński hace 5 años
padre
commit
4a0d7c21c2

+ 1 - 1
packages/ckeditor5-core/tests/_utils-tests/articlepluginset.js

@@ -45,7 +45,7 @@ describe( 'ArticlePluginSet', () => {
 		editorElement.remove();
 	} );
 
-	it.only( 'should be loaded', () => {
+	it( 'should be loaded', () => {
 		expect( editor.plugins.get( ArticlePluginSet ) ).to.be.instanceOf( ArticlePluginSet );
 	} );
 

+ 10 - 8
packages/ckeditor5-core/tests/_utils-tests/cleanup.js

@@ -11,17 +11,19 @@ import { removeEditorBodyOrphans } from '../_utils/cleanup';
 
 describe( 'cleanup util', () => {
 	describe( 'removeEditorBodyOrphans()', () => {
-		const locale = new Locale();
-		const uiViews = [ new EditorUIView( locale ), new EditorUIView( locale ) ];
+		it( 'cleans up all editor elements', () => {
+			const locale = new Locale();
+			const uiViews = [ new EditorUIView( locale ), new EditorUIView( locale ) ];
 
-		for ( const view of uiViews ) {
-			view.render();
-		}
+			for ( const view of uiViews ) {
+				view.render();
+			}
 
-		expect( document.querySelectorAll( '.ck-body' ) ).to.have.length( 2 );
+			expect( document.querySelectorAll( '.ck-body' ) ).to.have.length( 2 );
 
-		removeEditorBodyOrphans();
+			removeEditorBodyOrphans();
 
-		expect( document.querySelectorAll( '.ck-body' ) ).to.have.length( 0 );
+			expect( document.querySelectorAll( '.ck-body' ) ).to.have.length( 0 );
+		} );
 	} );
 } );