|
|
@@ -3,7 +3,7 @@
|
|
|
* For licensing, see LICENSE.md.
|
|
|
*/
|
|
|
|
|
|
-/* globals document, Event */
|
|
|
+/* globals document, Event, HTMLElement */
|
|
|
|
|
|
import InlineEditorUI from '../src/inlineeditorui';
|
|
|
import InlineEditorUIView from '../src/inlineeditoruiview';
|
|
|
@@ -95,6 +95,24 @@ describe( 'InlineEditor', () => {
|
|
|
} );
|
|
|
} );
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'allows to pass data to the constructor', () => {
|
|
|
+ return InlineEditor.create( '<p>Hello world!</p>', {
|
|
|
+ plugins: [ Paragraph ]
|
|
|
+ } ).then( editor => {
|
|
|
+ expect( editor.getData() ).to.equal( '<p>Hello world!</p>' );
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'editor.element should contain created div element', () => {
|
|
|
+ return InlineEditor.create( '<p>Hello world!</p>', {
|
|
|
+ plugins: [ Paragraph ]
|
|
|
+ } ).then( editor => {
|
|
|
+ expect( editor.element ).to.be.instanceOf( HTMLElement );
|
|
|
+ expect( editor.element.tagName ).to.equal( 'DIV' );
|
|
|
+ expect( editor.editing.view.getDomRoot() ).to.equal( editor.element );
|
|
|
+ } );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'create()', () => {
|