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 #333 from ckeditor/i/2082
Browse files Browse the repository at this point in the history
Tests: Fixed race condition in the image resizer unit tests. Closes ckeditor/ckeditor5#2082.
  • Loading branch information
jodator authored Oct 16, 2019
2 parents 71adead + db154eb commit b99cb16
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/imageresize.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,14 +562,23 @@ describe( 'ImageResize', () => {
// The image is 96x96 pixels.
const imageBaseUrl = '/assets/sample.png';
const getModel = () => editor.model.document.getRoot().getChild( 0 );
let image;

before( async () => {
image = await preloadImage( imageBaseUrl );
let images = [];

before( () => {
return Promise.all( [
preloadImage( imageBaseUrl ),
preloadImage( imageBaseUrl + '?a' ),
preloadImage( imageBaseUrl + '?b' ),
preloadImage( imageBaseUrl + '?c' )
] ).then( loadedImages => {
images = loadedImages;
} );
} );

after( () => {
image.remove();
for ( const image of images ) {
image.remove();
}
} );

beforeEach( () => {
Expand Down

0 comments on commit b99cb16

Please sign in to comment.