Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #129 from ckeditor/t/ckeditor5/1265
Browse files Browse the repository at this point in the history
Tests: Added an integration test for ckeditor/ckeditor5#1265.
  • Loading branch information
Reinmar authored Oct 26, 2018
2 parents 4b16e65 + db22d71 commit 0de4826
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@ckeditor/ckeditor5-list": "^11.0.2",
"@ckeditor/ckeditor5-media-embed": "^10.0.0",
"@ckeditor/ckeditor5-paragraph": "^10.0.3",
"@ckeditor/ckeditor5-typing": "^11.0.1",
"@ckeditor/ckeditor5-undo": "^10.0.3",
"@ckeditor/ckeditor5-utils": "^11.0.0",
"eslint": "^5.5.0",
Expand Down
3 changes: 2 additions & 1 deletion tests/manual/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import Table from '../../src/table';
import TableToolbar from '../../src/tabletoolbar';
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';

ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ ArticlePluginSet, Table, TableToolbar ],
plugins: [ ArticlePluginSet, Table, TableToolbar, BlockQuote ],
toolbar: [
'heading', '|', 'insertTable', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo'
],
Expand Down
25 changes: 25 additions & 0 deletions tests/table-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';
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 {
getData as getModelData,
Expand Down Expand Up @@ -148,4 +149,28 @@ describe( 'Table feature – integration', () => {
expect( editor.data.get( 'otherRoot' ) ).to.equal( viewTable( [ [ 'foo' ] ] ) );
} );
} );

describe( 'other', () => {
let editor;

beforeEach( () => {
return VirtualTestEditor
.create( { plugins: [ Paragraph, TableEditing, ListEditing, BlockQuoteEditing, Widget, Typing ] } )
.then( newEditor => {
editor = newEditor;
} );
} );

it( 'merges elements without throwing errors', () => {
setModelData( editor.model, modelTable( [
[ '<blockQuote><paragraph>Foo</paragraph></blockQuote><paragraph>[]Bar</paragraph>' ]
] ) );

editor.execute( 'delete' );

expect( formatTable( getModelData( editor.model ) ) ).to.equal( formattedModelTable( [
[ '<blockQuote><paragraph>Foo[]Bar</paragraph></blockQuote>' ]
] ) );
} );
} );
} );

0 comments on commit 0de4826

Please sign in to comment.