|
@@ -9,6 +9,7 @@ import VirtualTestEditor from '../../tests/_utils/virtualtesteditor';
|
|
|
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
|
|
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
|
|
|
import DataApiMixin from '../../src/editor/utils/dataapimixin';
|
|
import DataApiMixin from '../../src/editor/utils/dataapimixin';
|
|
|
import RootElement from '@ckeditor/ckeditor5-engine/src/model/rootelement';
|
|
import RootElement from '@ckeditor/ckeditor5-engine/src/model/rootelement';
|
|
|
|
|
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
|
|
|
|
|
|
|
|
import testUtils from '../../tests/_utils/utils';
|
|
import testUtils from '../../tests/_utils/utils';
|
|
|
|
|
|
|
@@ -33,5 +34,19 @@ describe( 'VirtualTestEditor', () => {
|
|
|
it( 'mixes DataApiMixin', () => {
|
|
it( 'mixes DataApiMixin', () => {
|
|
|
expect( testUtils.isMixed( VirtualTestEditor, DataApiMixin ) ).to.true;
|
|
expect( testUtils.isMixed( VirtualTestEditor, DataApiMixin ) ).to.true;
|
|
|
} );
|
|
} );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'supports `config.initialData`', () => {
|
|
|
|
|
+ return VirtualTestEditor.create( { initialData: '<p>foo</p>', plugins: [ Paragraph ] } )
|
|
|
|
|
+ .then( editor => {
|
|
|
|
|
+ expect( editor.getData() ).to.equal( '<p>foo</p>' );
|
|
|
|
|
+ } );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'initializes an empty editor if the `config.initialData` is not provided', () => {
|
|
|
|
|
+ return VirtualTestEditor.create()
|
|
|
|
|
+ .then( editor => {
|
|
|
|
|
+ expect( editor.getData() ).to.equal( '' );
|
|
|
|
|
+ } );
|
|
|
|
|
+ } );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|