|
@@ -17,7 +17,8 @@ import { parse as parseView } from '@ckeditor/ckeditor5-engine/src/dev-utils/vie
|
|
|
describe( 'Paragraph feature – integration', () => {
|
|
describe( 'Paragraph feature – integration', () => {
|
|
|
describe( 'with clipboard', () => {
|
|
describe( 'with clipboard', () => {
|
|
|
it( 'pastes h1+h2+p as p+p+p when heading feature is not present', () => {
|
|
it( 'pastes h1+h2+p as p+p+p when heading feature is not present', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -37,7 +38,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
|
|
|
|
|
// Explainer: the heading feature is configured to handle h2-h4 elements, so h1 has no handler.
|
|
// Explainer: the heading feature is configured to handle h2-h4 elements, so h1 has no handler.
|
|
|
it( 'pastes h1+h2+p as p+h2+p when heading feature is present', () => {
|
|
it( 'pastes h1+h2+p as p+h2+p when heading feature is present', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, Clipboard, HeadingEngine ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, Clipboard, HeadingEngine ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -56,7 +58,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'pastes ul>li+li as p+p when list feature is not present', () => {
|
|
it( 'pastes ul>li+li as p+p when list feature is not present', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -75,7 +78,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
// Check whether the paragraph feature doesn't breaking pasting such content by trying to
|
|
// Check whether the paragraph feature doesn't breaking pasting such content by trying to
|
|
|
// handle the li element.
|
|
// handle the li element.
|
|
|
it( 'pastes ul>li>h2+h3+p as h2+h3+p when heading feature is present', () => {
|
|
it( 'pastes ul>li>h2+h3+p as h2+h3+p when heading feature is present', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, Clipboard, HeadingEngine ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, Clipboard, HeadingEngine ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -97,7 +101,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
|
|
|
|
|
// See 'should convert ul>li>ul>li+li (in clipboard holder)' in clipboard.js.
|
|
// See 'should convert ul>li>ul>li+li (in clipboard holder)' in clipboard.js.
|
|
|
it( 'pastes ul>li>ul>li+li', () => {
|
|
it( 'pastes ul>li>ul>li+li', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -119,7 +124,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
|
|
|
|
|
// See 'should convert ul>li>p,text (in clipboard holder)' in clipboard.js.
|
|
// See 'should convert ul>li>p,text (in clipboard holder)' in clipboard.js.
|
|
|
it( 'pastes ul>li>p,text', () => {
|
|
it( 'pastes ul>li>p,text', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, Clipboard ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -141,7 +147,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
|
|
|
|
|
describe( 'with undo', () => {
|
|
describe( 'with undo', () => {
|
|
|
it( 'fixing empty roots should be transparent to undo', () => {
|
|
it( 'fixing empty roots should be transparent to undo', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, UndoEngine ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, UndoEngine ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|
|
@@ -173,7 +180,8 @@ describe( 'Paragraph feature – integration', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'fixing empty roots should be transparent to undo - multiple roots', () => {
|
|
it( 'fixing empty roots should be transparent to undo - multiple roots', () => {
|
|
|
- return VirtualTestEditor.create( { plugins: [ Paragraph, UndoEngine ] } )
|
|
|
|
|
|
|
+ return VirtualTestEditor
|
|
|
|
|
+ .create( { plugins: [ Paragraph, UndoEngine ] } )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
const editor = newEditor;
|
|
const editor = newEditor;
|
|
|
const doc = editor.document;
|
|
const doc = editor.document;
|