|
|
@@ -218,34 +218,29 @@ describe( 'Image converters', () => {
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- it( 'should convert an empty "alt" attribute from image even if removed', () => {
|
|
|
+ it( 'should convert an empty "src" attribute from image even if removed', () => {
|
|
|
setModelData( model, '<image src="" alt="foo bar"></image>' );
|
|
|
const image = document.getRoot().getChild( 0 );
|
|
|
|
|
|
model.change( writer => {
|
|
|
- writer.removeAttribute( 'alt', image );
|
|
|
+ writer.removeAttribute( 'src', image );
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
|
|
|
- '<figure class="ck-widget image" contenteditable="false"><img alt="" src=""></img></figure>'
|
|
|
+ '<figure class="ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
- 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>' );
|
|
|
+ it( 'should convert an empty "alt" attribute from image even if removed', () => {
|
|
|
+ setModelData( model, '<image src="" alt="foo bar"></image>' );
|
|
|
const image = document.getRoot().getChild( 0 );
|
|
|
|
|
|
model.change( writer => {
|
|
|
- writer.removeAttribute( 'foo', image );
|
|
|
+ writer.removeAttribute( 'alt', image );
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
|
|
|
- '<figure class="ck-widget image" contenteditable="false"><img alt="bar" src=""></img></figure>'
|
|
|
+ '<figure class="ck-widget image" contenteditable="false"><img alt="" src=""></img></figure>'
|
|
|
);
|
|
|
} );
|
|
|
|