8
0
Просмотр исходного кода

Added tests checking data initialization.

Szymon Kupś 7 лет назад
Родитель
Сommit
6a49ccde44
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      packages/ckeditor5-editor-classic/tests/classiceditor.js

+ 16 - 0
packages/ckeditor5-editor-classic/tests/classiceditor.js

@@ -88,6 +88,22 @@ describe( 'ClassicEditor', () => {
 			} );
 		} );
 
+		it( 'allows to pass data to the constructor', () => {
+			return ClassicEditor.create( '<p>Hello world!</p>', {
+				plugins: [ Paragraph ]
+			} ).then( editor => {
+				expect( editor.getData() ).to.equal( '<p>Hello world!</p>' );
+			} );
+		} );
+
+		it( 'editor.element should be equal to editor.ui.view.element when data is passed', () => {
+			return ClassicEditor.create( '<p>Hello world!</p>', {
+				plugins: [ Paragraph ]
+			} ).then( editor => {
+				expect( editor.element ).to.equal( editor.ui.view.element );
+			} );
+		} );
+
 		describe( 'ui', () => {
 			it( 'creates the UI using BoxedEditorUI classes', () => {
 				expect( editor.ui ).to.be.instanceof( ClassicEditorUI );