Kaynağa Gözat

Merge branch 'master' into t/engine/1186

Oskar Wróbel 8 yıl önce
ebeveyn
işleme
ea79f0b0e6

+ 1 - 3
packages/ckeditor5-link/tests/link.js

@@ -33,8 +33,6 @@ describe( 'Link', () => {
 				plugins: [ Link, Paragraph ]
 			} )
 			.then( newEditor => {
-				newEditor.editing.view.attachDomRoot( editorElement );
-
 				editor = newEditor;
 
 				linkFeature = editor.plugins.get( Link );
@@ -114,7 +112,7 @@ describe( 'Link', () => {
 			'that link',
 		() => {
 			setModelData( editor.model, '<paragraph><$text linkHref="url">f[]oo</$text></paragraph>' );
-			const linkElement = editorElement.querySelector( 'a' );
+			const linkElement = editor.editing.view.getDomRoot().querySelector( 'a' );
 
 			linkFeature._showPanel();
 

+ 16 - 5
packages/ckeditor5-link/tests/unlinkcommand.js

@@ -67,11 +67,22 @@ describe( 'UnlinkCommand', () => {
 
 				command.execute();
 
-				expect( getData( model ) ).to.equal(
-					'<$text bold="true" linkHref="url">f</$text>' +
-					'[<$text bold="true">ooba</$text>]' +
-					'<$text bold="true" linkHref="url">r</$text>'
-				);
+				const assertAll = () => {
+					expect( getData( model ) ).to.equal(
+						'<$text bold="true" linkHref="url">f</$text>' +
+						'[<$text bold="true">ooba</$text>]' +
+						'<$text bold="true" linkHref="url">r</$text>'
+					);
+				};
+
+				const assertEdge = () => {
+					expect( getData( model ) ).to.equal(
+						'<$text bold="true" linkHref="url">f</$text>' +
+						'[<$text bold="true">ooba]<$text linkHref="url">r</$text></$text>'
+					);
+				};
+
+				testUtils.checkAssertions( assertAll, assertEdge );
 			} );
 
 			it( 'should remove `linkHref` attribute from selected text when attributes have different value', () => {