|
|
@@ -294,7 +294,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
it( 'should use read data once it is present', done => {
|
|
|
const file = createNativeFileMock();
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
model.once( '_change', () => {
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
@@ -314,7 +314,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
it( 'should replace read data with server response once it is present', done => {
|
|
|
const file = createNativeFileMock();
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
model.document.once( 'change', () => {
|
|
|
model.document.once( 'change', () => {
|
|
|
@@ -345,7 +345,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
}, { priority: 'high' } );
|
|
|
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
nativeReaderMock.mockError( 'Reading error.' );
|
|
|
} );
|
|
|
@@ -361,7 +361,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
}, { priority: 'high' } );
|
|
|
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
nativeReaderMock.abort();
|
|
|
|
|
|
setTimeout( () => {
|
|
|
@@ -385,7 +385,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
} );
|
|
|
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
sinon.assert.calledOnce( loadSpy );
|
|
|
|
|
|
@@ -422,7 +422,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
evt.stop();
|
|
|
}, { priority: 'high' } );
|
|
|
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
model.document.once( 'change', () => {
|
|
|
model.document.once( 'change', () => {
|
|
|
@@ -439,7 +439,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
it( 'should abort upload if image is removed', () => {
|
|
|
const file = createNativeFileMock();
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
const abortSpy = testUtils.sinon.spy( loader, 'abort' );
|
|
|
|
|
|
@@ -458,7 +458,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
it( 'should not abort and not restart upload when image is moved', () => {
|
|
|
const file = createNativeFileMock();
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
const abortSpy = testUtils.sinon.spy( loader, 'abort' );
|
|
|
const loadSpy = testUtils.sinon.spy( loader, 'read' );
|
|
|
@@ -483,7 +483,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
evt.stop();
|
|
|
}, { priority: 'high' } );
|
|
|
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
model.document.once( 'change', () => {
|
|
|
// This is called after "manual" remove.
|
|
|
@@ -519,7 +519,7 @@ describe( 'ImageUploadEditing', () => {
|
|
|
it( 'should create responsive image if server return multiple images', done => {
|
|
|
const file = createNativeFileMock();
|
|
|
setModelData( model, '<paragraph>{}foo bar</paragraph>' );
|
|
|
- editor.execute( 'imageUpload', { files: file } );
|
|
|
+ editor.execute( 'imageUpload', { file } );
|
|
|
|
|
|
model.document.once( 'change', () => {
|
|
|
model.document.once( 'change', () => {
|