소스 검색

Merge pull request #129 from ckeditor/t/ckeditor5/1265

Tests: Added an integration test for ckeditor/ckeditor5#1265.
Piotrek Koszuliński 7 년 전
부모
커밋
0599faeb54
3개의 변경된 파일28개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      packages/ckeditor5-table/package.json
  2. 2 1
      packages/ckeditor5-table/tests/manual/table.js
  3. 25 0
      packages/ckeditor5-table/tests/table-integration.js

+ 1 - 0
packages/ckeditor5-table/package.json

@@ -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",

+ 2 - 1
packages/ckeditor5-table/tests/manual/table.js

@@ -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'
 		],

+ 25 - 0
packages/ckeditor5-table/tests/table-integration.js

@@ -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,
@@ -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>' ]
+			] ) );
+		} );
+	} );
 } );