|
|
@@ -3,7 +3,7 @@
|
|
|
* For licensing, see LICENSE.md.
|
|
|
*/
|
|
|
|
|
|
-import { viewToModelImage, modelToViewSelection, createImageAttributeConverter } from '../src/converters';
|
|
|
+import { viewToModelImage, createImageAttributeConverter } from '../src/converters';
|
|
|
import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
|
|
|
import { createImageViewElement } from '../src/imageengine';
|
|
|
import { toImageWidget } from '../src/utils';
|
|
|
@@ -32,7 +32,6 @@ describe( 'Image converters', () => {
|
|
|
.fromElement( 'image' )
|
|
|
.toElement( () => toImageWidget( createImageViewElement() ) );
|
|
|
|
|
|
- editor.editing.modelToView.on( 'selection', modelToViewSelection( editor.t ), { priority: 'lowest' } );
|
|
|
buildModelConverter().for( editor.editing.modelToView )
|
|
|
.fromElement( 'image' )
|
|
|
.toElement( () => toImageWidget( createImageViewElement() ) );
|
|
|
@@ -101,28 +100,6 @@ describe( 'Image converters', () => {
|
|
|
}
|
|
|
} );
|
|
|
|
|
|
- describe( 'modelToViewSelection', () => {
|
|
|
- it( 'should convert selection over image to fake selection', () => {
|
|
|
- setModelData( document, '[<image src=""></image>]' );
|
|
|
-
|
|
|
- expect( viewDocument.selection.isFake ).to.be.true;
|
|
|
- expect( viewDocument.selection.fakeSelectionLabel ).to.equal( 'image widget' );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should convert fake selection label with alt', () => {
|
|
|
- setModelData( document, '[<image src="" alt="foo bar"></image>]' );
|
|
|
-
|
|
|
- expect( viewDocument.selection.isFake ).to.be.true;
|
|
|
- expect( viewDocument.selection.fakeSelectionLabel ).to.equal( 'foo bar image widget' );
|
|
|
- } );
|
|
|
-
|
|
|
- it( 'should not convert fake selection if image is not selected', () => {
|
|
|
- setModelData( document, '[]<image src="" alt="foo bar"></image>' );
|
|
|
-
|
|
|
- expect( viewDocument.selection.isFake ).to.be.false;
|
|
|
- } );
|
|
|
- } );
|
|
|
-
|
|
|
describe( 'modelToViewAttributeConverter', () => {
|
|
|
it( 'should convert adding attribute to image', () => {
|
|
|
setModelData( document, '<image src=""></image>' );
|