浏览代码

Fix tests for mention editing.

Maciej Gołaszewski 6 年之前
父节点
当前提交
cc656a64e7

+ 3 - 3
packages/ckeditor5-mention/tests/mention-integration.js

@@ -97,7 +97,7 @@ describe( 'Mention feature - integration', () => {
 		it( 'should work with attribute post-fixer (beginning formatted)', () => {
 			testAttributePostFixer(
 				'<p>foo <span class="mention" data-mention="John">@John</span> bar</p>',
-				'<p><strong>foo </strong><span class="mention" data-mention="John"><strong>@John</strong></span> bar</p>',
+				'<p><strong>foo <span class="mention" data-mention="John">@John</span></strong> bar</p>',
 				() => {
 					model.change( writer => {
 						const paragraph = doc.getRoot().getChild( 0 );
@@ -114,7 +114,7 @@ describe( 'Mention feature - integration', () => {
 		it( 'should work with attribute post-fixer (end formatted)', () => {
 			testAttributePostFixer(
 				'<p>foo <span class="mention" data-mention="John">@John</span> bar</p>',
-				'<p>foo <span class="mention" data-mention="John"><strong>@John</strong></span><strong> ba</strong>r</p>',
+				'<p>foo <strong><span class="mention" data-mention="John">@John</span> ba</strong>r</p>',
 				() => {
 					model.change( writer => {
 						const paragraph = doc.getRoot().getChild( 0 );
@@ -131,7 +131,7 @@ describe( 'Mention feature - integration', () => {
 		it( 'should work with attribute post-fixer (middle formatted)', () => {
 			testAttributePostFixer(
 				'<p>foo <span class="mention" data-mention="John">@John</span> bar</p>',
-				'<p>foo <span class="mention" data-mention="John"><strong>@John</strong></span> bar</p>',
+				'<p>foo <strong><span class="mention" data-mention="John">@John</span></strong> bar</p>',
 				() => {
 					model.change( writer => {
 						const paragraph = doc.getRoot().getChild( 0 );

+ 7 - 5
packages/ckeditor5-mention/tests/mentionediting.js

@@ -396,7 +396,7 @@ describe( 'MentionEditing', () => {
 			} );
 
 			expect( editor.getData() )
-				.to.equal( '<p><strong>foo </strong><span class="mention" data-mention="John"><strong>@John</strong></span> bar</p>' );
+				.to.equal( '<p><strong>foo <span class="mention" data-mention="John">@John</span></strong> bar</p>' );
 		} );
 
 		it( 'should set attribute on whole mention when formatting part of a mention (end formatted)', () => {
@@ -417,7 +417,7 @@ describe( 'MentionEditing', () => {
 			} );
 
 			expect( editor.getData() )
-				.to.equal( '<p>foo <span class="mention" data-mention="John"><strong>@John</strong></span><strong> ba</strong>r</p>' );
+				.to.equal( '<p>foo <strong><span class="mention" data-mention="John">@John</span> ba</strong>r</p>' );
 		} );
 
 		it( 'should set attribute on whole mention when formatting part of a mention (middle of mention formatted)', () => {
@@ -438,7 +438,7 @@ describe( 'MentionEditing', () => {
 			} );
 
 			expect( editor.getData() )
-				.to.equal( '<p>foo <span class="mention" data-mention="John"><strong>@John</strong></span> bar</p>' );
+				.to.equal( '<p>foo <strong><span class="mention" data-mention="John">@John</span></strong> bar</p>' );
 		} );
 
 		it( 'should set attribute on whole mention when formatting part of two mentions', () => {
@@ -462,8 +462,10 @@ describe( 'MentionEditing', () => {
 
 			expect( editor.getData() ).to.equal(
 				'<p>' +
-					'<span class="mention" data-mention="John"><strong>@John</strong></span>' +
-					'<span class="mention" data-mention="John"><strong>@John</strong></span>' +
+					'<strong>' +
+						'<span class="mention" data-mention="John">@John</span>' +
+						'<span class="mention" data-mention="John">@John</span>' +
+					'</strong>' +
 				'</p>'
 			);
 		} );