소스 검색

Added tests for coverting text with inline filler.

Maciej Bukowski 8 년 전
부모
커밋
10c27d129a
1개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 24 0
      packages/ckeditor5-engine/tests/view/domconverter/dom-to-view.js

+ 24 - 0
packages/ckeditor5-engine/tests/view/domconverter/dom-to-view.js

@@ -525,6 +525,30 @@ describe( 'DomConverter', () => {
 			// See also whitespace-handling-integration.js.
 			// See also whitespace-handling-integration.js.
 			//
 			//
 		} );
 		} );
+
+		describe( 'clearing auto filler', () => {
+			it( 'should remove inline filler when converting dom to view', () => {
+				const text = document.createTextNode( INLINE_FILLER + 'foo' );
+				const view = converter.domToView( text );
+
+				expect( view.data ).to.equal( 'foo' );
+			} );
+
+			// See https://github.com/ckeditor/ckeditor5/issues/692.
+			it( 'should not remove space after inline filler if previous node nor next node does not exist', () => {
+				const text = document.createTextNode( INLINE_FILLER + ' ' );
+				const view = converter.domToView( text );
+
+				expect( view.data ).to.equal( ' ' );
+			} );
+
+			it( 'should convert non breaking space to normal space after inline filler', () => {
+				const text = document.createTextNode( INLINE_FILLER + '\u00A0' );
+				const view = converter.domToView( text );
+
+				expect( view.data ).to.equal( ' ' );
+			} );
+		} );
 	} );
 	} );
 
 
 	describe( 'domChildrenToView', () => {
 	describe( 'domChildrenToView', () => {