|
|
@@ -11,7 +11,7 @@ import UndoEditing from '@ckeditor/ckeditor5-undo/src/undoediting';
|
|
|
import ListEditing from '@ckeditor/ckeditor5-list/src/listediting';
|
|
|
import BlockQuoteEditing from '@ckeditor/ckeditor5-block-quote/src/blockquoteediting';
|
|
|
import Typing from '@ckeditor/ckeditor5-typing/src/typing';
|
|
|
-import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
|
|
|
+import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
|
|
|
import {
|
|
|
getData as getModelData,
|
|
|
setData as setModelData
|
|
|
@@ -27,14 +27,18 @@ describe( 'Table feature – integration', () => {
|
|
|
let editor, clipboard;
|
|
|
|
|
|
beforeEach( () => {
|
|
|
- return VirtualTestEditor
|
|
|
- .create( { plugins: [ Paragraph, TableEditing, ListEditing, BlockQuoteEditing, Widget, Clipboard ] } )
|
|
|
+ return ClassicTestEditor
|
|
|
+ .create( '', { plugins: [ Paragraph, TableEditing, ListEditing, BlockQuoteEditing, Widget, Clipboard ] } )
|
|
|
.then( newEditor => {
|
|
|
editor = newEditor;
|
|
|
clipboard = editor.plugins.get( 'Clipboard' );
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
+ afterEach( () => {
|
|
|
+ editor.destroy();
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'pastes td as p when pasting into the table', () => {
|
|
|
setModelData( editor.model, modelTable( [ [ 'foo[]' ] ] ) );
|
|
|
|
|
|
@@ -86,8 +90,8 @@ describe( 'Table feature – integration', () => {
|
|
|
let editor, doc, root;
|
|
|
|
|
|
beforeEach( () => {
|
|
|
- return VirtualTestEditor
|
|
|
- .create( { plugins: [ Paragraph, TableEditing, Widget, UndoEditing ] } )
|
|
|
+ return ClassicTestEditor
|
|
|
+ .create( '', { plugins: [ Paragraph, TableEditing, Widget, UndoEditing ] } )
|
|
|
.then( newEditor => {
|
|
|
editor = newEditor;
|
|
|
doc = editor.model.document;
|
|
|
@@ -95,6 +99,10 @@ describe( 'Table feature – integration', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
+ afterEach( () => {
|
|
|
+ editor.destroy();
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'fixing empty roots should be transparent to undo', () => {
|
|
|
expect( editor.getData( { trim: 'none' } ) ).to.equal( '<p> </p>' );
|
|
|
expect( editor.commands.get( 'undo' ).isEnabled ).to.be.false;
|
|
|
@@ -155,13 +163,17 @@ describe( 'Table feature – integration', () => {
|
|
|
let editor;
|
|
|
|
|
|
beforeEach( () => {
|
|
|
- return VirtualTestEditor
|
|
|
- .create( { plugins: [ Paragraph, TableEditing, ListEditing, BlockQuoteEditing, Widget, Typing ] } )
|
|
|
+ return ClassicTestEditor
|
|
|
+ .create( '', { plugins: [ Paragraph, TableEditing, ListEditing, BlockQuoteEditing, Widget, Typing ] } )
|
|
|
.then( newEditor => {
|
|
|
editor = newEditor;
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
+ afterEach( () => {
|
|
|
+ editor.destroy();
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'merges elements without throwing errors', () => {
|
|
|
setModelData( editor.model, modelTable( [
|
|
|
[ '<blockQuote><paragraph>Foo</paragraph></blockQuote><paragraph>[]Bar</paragraph>' ]
|