Ver código fonte

Add more tests.

panr 5 anos atrás
pai
commit
35471248b7
1 arquivos alterados com 20 adições e 0 exclusões
  1. 20 0
      packages/ckeditor5-link/tests/autolink.js

+ 20 - 0
packages/ckeditor5-link/tests/autolink.js

@@ -130,6 +130,26 @@ describe( 'AutoLink', () => {
 			);
 		} );
 
+		it( 'does not add linkHref attribute on enter when the link is partially selected (beginning)', () => {
+			setData( model, '<paragraph>[https://www.ckso]urce.com</paragraph>' );
+
+			editor.execute( 'enter' );
+
+			expect( getData( model ) ).to.equal(
+				'<paragraph>[]</paragraph>'
+			);
+		} );
+
+		it( 'does not add linkHref attribute on enter when the link is partially selected (end)', () => {
+			setData( model, '<paragraph>https://www.ckso[urce.com]</paragraph>' );
+
+			editor.execute( 'enter' );
+
+			expect( getData( model ) ).to.equal(
+				'<paragraph>[]</paragraph>'
+			);
+		} );
+
 		it( 'adds linkHref attribute to a text link after space (inside paragraph)', () => {
 			setData( model, '<paragraph>Foo Bar [] Baz</paragraph>' );