Browse Source

Tests: Make sure that undo integration does not randomly fail.

Marek Lewandowski 5 years ago
parent
commit
0e1323fb33
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/ckeditor5-image/tests/imageresize.js

+ 3 - 2
packages/ckeditor5-image/tests/imageresize.js

@@ -272,9 +272,10 @@ describe( 'ImageResize', () => {
 
 			expect( '120px' ).to.be.equal( domParts.widget.style.width );
 
-			editor.commands.get( 'undo' ).execute();
+			// ui#update (fired after undo changes) handling is throttled. Wait, so that it will redraw instantly.
+			await wait( 200 );
 
-			await wait( 200 ); // ui#update event is throttled.
+			editor.commands.get( 'undo' ).execute();
 
 			const resizerWrapper = document.querySelector( '.ck-widget__resizer' );
 			const shadowBoundingRect = resizerWrapper.getBoundingClientRect();