Selaa lähdekoodia

Merge pull request #161 from ckeditor/t/158

Tests: Fixed failed tests on Edge . Closes #158.
Szymon Kupś 8 vuotta sitten
vanhempi
commit
20d5746361

+ 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.document, '<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

@@ -66,11 +66,22 @@ describe( 'UnlinkCommand', () => {
 
 				command.execute();
 
-				expect( getData( document ) ).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( document ) ).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( document ) ).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', () => {