Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #18 from ckeditor/t/ckeditor5/1218
Browse files Browse the repository at this point in the history
Tests: Fixed failing tests after upgrading Sinon. See ckeditor/ckeditor5#1218.
  • Loading branch information
pomek committed Aug 24, 2018
2 parents 76dc1e9 + 087e65d commit feadbc2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/easyimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ describe( 'EasyImage', () => {

describe( 'integration tests', () => {
const CSUploader = CloudServicesUploadAdapter._UploadGateway;
const sandbox = sinon.sandbox.create();
let div;

before( () => {
// Mock uploader.
CloudServicesUploadAdapter._UploadGateway = UploadGatewayMock;
sandbox.stub( window, 'FileReader' ).callsFake( () => {
sinon.stub( window, 'FileReader' ).callsFake( () => {
const reader = {
readAsDataURL: () => {
reader.result = 'http://some-fake-url.jpg';
Expand All @@ -81,7 +80,6 @@ describe( 'EasyImage', () => {
after( () => {
// Restore original uploader.
CloudServicesUploadAdapter._UploadGateway = CSUploader;
sandbox.restore();
} );

beforeEach( () => {
Expand All @@ -91,6 +89,7 @@ describe( 'EasyImage', () => {

afterEach( () => {
window.document.body.removeChild( div );
sinon.restore();
} );

it( 'should enable easy image uploading', () => {
Expand Down

0 comments on commit feadbc2

Please sign in to comment.