Procházet zdrojové kódy

Merge pull request #88 from ckeditor/t/ckeditor5-core/134

Tests: Fixed tests broken by ckeditor/ckeditor5-core#135: `Editor#destroy` waits for the initialization.
Piotr Jasiun před 7 roky
rodič
revize
3d1fecc719

+ 6 - 5
packages/ckeditor5-undo/tests/redocommand.js

@@ -15,12 +15,13 @@ describe( 'RedoCommand', () => {
 	let editor, model, root, redo, undo;
 
 	beforeEach( () => {
-		editor = new ModelTestEditor();
-		redo = new RedoCommand( editor );
+		return ModelTestEditor.create().then( newEditor => {
+			editor = newEditor;
 
-		model = editor.model;
-
-		root = model.document.getRoot();
+			redo = new RedoCommand( editor );
+			model = editor.model;
+			root = model.document.getRoot();
+		} );
 	} );
 
 	afterEach( () => {

+ 7 - 6
packages/ckeditor5-undo/tests/undocommand.js

@@ -14,13 +14,14 @@ describe( 'UndoCommand', () => {
 	let editor, model, doc, root, undo;
 
 	beforeEach( () => {
-		editor = new ModelTestEditor();
-		undo = new UndoCommand( editor );
+		return ModelTestEditor.create().then( newEditor => {
+			editor = newEditor;
 
-		model = editor.model;
-		doc = model.document;
-
-		root = doc.getRoot();
+			undo = new UndoCommand( editor );
+			model = editor.model;
+			doc = model.document;
+			root = doc.getRoot();
+		} );
 	} );
 
 	afterEach( () => {