瀏覽代碼

Tests: added additional tests.

Szymon Cofalik 8 年之前
父節點
當前提交
5e6ce23950
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      packages/ckeditor5-link/tests/linkengine.js

+ 12 - 0
packages/ckeditor5-link/tests/linkengine.js

@@ -32,6 +32,7 @@ describe( 'LinkEngine', () => {
 	} );
 
 	it( 'should set proper schema rules', () => {
+		expect( doc.schema.check( { name: '$inline', attributes: [ 'linkHref' ], inside: '$root' } ) ).to.be.false;
 		expect( doc.schema.check( { name: '$inline', attributes: [ 'linkHref' ], inside: '$block' } ) ).to.be.true;
 	} );
 
@@ -62,6 +63,17 @@ describe( 'LinkEngine', () => {
 
 			expect( editor.getData() ).to.equal( '<p><a href="url">foo</a>bar</p>' );
 		} );
+
+		it( 'should be integrated with autoparagraphing', () => {
+			// Incorrect results because autoparagraphing works incorrectly (issue in paragraph).
+			// https://github.com/ckeditor/ckeditor5-paragraph/issues/10
+
+			editor.setData( '<a href="url">foo</a>bar' );
+
+			expect( getModelData( doc, { withoutSelection: true } ) ).to.equal( '<paragraph>foobar</paragraph>' );
+
+			expect( editor.getData() ).to.equal( '<p>foobar</p>' );
+		} );
 	} );
 
 	describe( 'editing pipeline conversion', () => {