Explorar el Código

Tests: added additional tests.

Szymon Cofalik hace 8 años
padre
commit
5e6ce23950
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  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', () => {