ソースを参照

Added missing test.

Kamil Piechaczek 5 年 前
コミット
d70cbead3c
1 ファイル変更18 行追加0 行削除
  1. 18 0
      packages/ckeditor5-image/tests/image/converters.js

+ 18 - 0
packages/ckeditor5-image/tests/image/converters.js

@@ -231,6 +231,24 @@ describe( 'Image converters', () => {
 			);
 		} );
 
+		it( 'should convert attribute removal', () => {
+			model.schema.extend( 'image', { allowAttributes: 'foo' } );
+
+			editor.conversion.for( 'downcast' )
+				.add( modelToViewAttributeConverter( 'foo' ) );
+
+			setModelData( model, '<image src="" alt="bar" foo="bar"></image>' );
+			const image = document.getRoot().getChild( 0 );
+
+			model.change( writer => {
+				writer.removeAttribute( 'foo', image );
+			} );
+
+			expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
+				'<figure class="ck-widget image" contenteditable="false"><img alt="bar" src=""></img></figure>'
+			);
+		} );
+
 		it( 'should convert change of attribute image', () => {
 			setModelData( model, '<image src="" alt="foo bar"></image>' );
 			const image = document.getRoot().getChild( 0 );