|
|
@@ -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 );
|