Selaa lähdekoodia

Tests: No need for double model checking, it's verified using a regexp few lines above.

Marek Lewandowski 6 vuotta sitten
vanhempi
sitoutus
6a6d73b7a5
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      packages/ckeditor5-image/tests/imageresize.js

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

@@ -606,9 +606,9 @@ describe( 'ImageResize', () => {
 					} ) ).to.match( modelRegExp );
 					} ) ).to.match( modelRegExp );
 
 
 					const modelItem = options.getModel ? options.getModel() : editor.model.document.getRoot().getChild( 1 );
 					const modelItem = options.getModel ? options.getModel() : editor.model.document.getRoot().getChild( 1 );
+					const modelWidth = modelItem.getAttribute( 'width' );
 
 
-					expect( modelItem.getAttribute( 'width' ) ).to.match( /^([\d]+)px$/, 'Model width is properly formatted' );
-					expect( parseFloat( modelItem.getAttribute( 'width' ), 0 ) )
+					expect( parseFloat( modelWidth, 0 ) )
 						.to.be.closeTo( options.expectedWidth, 2, 'Model width check' );
 						.to.be.closeTo( options.expectedWidth, 2, 'Model width check' );
 				} );
 				} );
 		};
 		};