Przeglądaj źródła

Fixed file extension in srcset attribute in ImageEngine tests.

Szymon Kupś 8 lat temu
rodzic
commit
812d6de425
1 zmienionych plików z 13 dodań i 11 usunięć
  1. 13 11
      packages/ckeditor5-image/tests/image/imageengine.js

+ 13 - 11
packages/ckeditor5-image/tests/image/imageengine.js

@@ -49,11 +49,11 @@ describe( 'ImageEngine', () => {
 			} );
 
 			it( 'should convert with srcset attribute and add sizes attribute', () => {
-				setModelData( document, '<image src="foo.png" alt="alt text" srcset="small 148w, big.png 1024w"></image>' );
+				setModelData( document, '<image src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w"></image>' );
 
 				expect( editor.getData() ).to.equal(
 					'<figure class="image">' +
-						'<img srcset="small 148w, big.png 1024w" sizes="100vw" alt="alt text" src="foo.png">' +
+						'<img srcset="small.png 148w, big.png 1024w" sizes="100vw" alt="alt text" src="foo.png">' +
 					'</figure>'
 				);
 			} );
@@ -187,23 +187,23 @@ describe( 'ImageEngine', () => {
 			it( 'should convert image with srcset attribute', () => {
 				editor.setData(
 					'<figure class="image">' +
-						'<img src="foo.png" alt="alt text" srcset="small 148w, big.png 1024w" />' +
+						'<img src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w" />' +
 					'</figure>'
 				);
 
 				expect( getModelData( document, { withoutSelection: true } ) )
-					.to.equal( '<image alt="alt text" src="foo.png" srcset="small 148w, big.png 1024w"></image>' );
+					.to.equal( '<image alt="alt text" src="foo.png" srcset="small.png 148w, big.png 1024w"></image>' );
 			} );
 
 			it( 'should ignore sizes attribute', () => {
 				editor.setData(
 					'<figure class="image">' +
-						'<img src="foo.png" alt="alt text" srcset="small 148w, big.png 1024w" sizes="50vw" />' +
+						'<img src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w" sizes="50vw" />' +
 					'</figure>'
 				);
 
 				expect( getModelData( document, { withoutSelection: true } ) )
-					.to.equal( '<image alt="alt text" src="foo.png" srcset="small 148w, big.png 1024w"></image>' );
+					.to.equal( '<image alt="alt text" src="foo.png" srcset="small.png 148w, big.png 1024w"></image>' );
 			} );
 
 			describe( 'should autohoist images', () => {
@@ -385,11 +385,11 @@ describe( 'ImageEngine', () => {
 			} );
 
 			it( 'should convert srcset attribute to srcset and sizes', () => {
-				setModelData( document, '<image src="foo.png" alt="alt text" srcset="small 148w, big.png 1024w"></image>' );
+				setModelData( document, '<image src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w"></image>' );
 
 				expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
 					'<figure class="image ck-widget" contenteditable="false">' +
-						'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small 148w, big.png 1024w"></img>' +
+						'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
 					'</figure>'
 				);
 			} );
@@ -402,18 +402,20 @@ describe( 'ImageEngine', () => {
 					}
 				} )
 				.then( newEditor => {
-					setModelData( newEditor.document, '<image src="foo.png" alt="alt text" srcset="small 148w, big.png 1024w"></image>' );
+					setModelData( newEditor.document,
+						'<image src="foo.png" alt="alt text" srcset="small.png 148w, big.png 1024w"></image>'
+					);
 
 					expect( getViewData( newEditor.editing.view, { withoutSelection: true } ) ).to.equal(
 						'<figure class="image ck-widget" contenteditable="false">' +
-						'<img alt="alt text" sizes="50vf" src="foo.png" srcset="small 148w, big.png 1024w"></img>' +
+						'<img alt="alt text" sizes="50vf" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
 						'</figure>'
 					);
 				} );
 			} );
 
 			it( 'should remove sizes attribute when srcset attribute is removed', () => {
-				setModelData( document, '<image src="foo.png" srcset="small 148w, big.png 1024w"></image>' );
+				setModelData( document, '<image src="foo.png" srcset="small.png 148w, big.png 1024w"></image>' );
 				const image = document.getRoot().getChild( 0 );
 
 				document.enqueueChanges( () => {