Przeglądaj źródła

Fix upcoming ESLint problems in tests.

Maciej Gołaszewski 6 lat temu
rodzic
commit
9f1e04d9be
1 zmienionych plików z 21 dodań i 21 usunięć
  1. 21 21
      packages/ckeditor5-image/tests/imageresize.js

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

@@ -172,9 +172,9 @@ describe( 'ImageResize', () => {
 	} );
 	} );
 
 
 	describe( 'visual resizers', () => {
 	describe( 'visual resizers', () => {
-		beforeEach( () => createEditor() );
+		beforeEach( async () => {
+			await createEditor();
 
 
-		beforeEach( () => {
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 
 
 			widget = viewDocument.getRoot().getChild( 1 );
 			widget = viewDocument.getRoot().getChild( 1 );
@@ -214,9 +214,9 @@ describe( 'ImageResize', () => {
 	} );
 	} );
 
 
 	describe( 'standard image resizing', () => {
 	describe( 'standard image resizing', () => {
-		beforeEach( () => createEditor() );
+		beforeEach( async () => {
+			await createEditor();
 
 
-		beforeEach( () => {
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 
 
 			widget = viewDocument.getRoot().getChild( 1 );
 			widget = viewDocument.getRoot().getChild( 1 );
@@ -316,9 +316,9 @@ describe( 'ImageResize', () => {
 	} );
 	} );
 
 
 	describe( 'side image resizing', () => {
 	describe( 'side image resizing', () => {
-		beforeEach( () => createEditor() );
+		beforeEach( async () => {
+			await createEditor();
 
 
-		beforeEach( () => {
 			setData( editor.model, `<paragraph>foo</paragraph>[<image imageStyle="side" src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 			setData( editor.model, `<paragraph>foo</paragraph>[<image imageStyle="side" src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 
 
 			widget = viewDocument.getRoot().getChild( 1 );
 			widget = viewDocument.getRoot().getChild( 1 );
@@ -529,9 +529,9 @@ describe( 'ImageResize', () => {
 	} );
 	} );
 
 
 	describe( 'undo integration', () => {
 	describe( 'undo integration', () => {
-		beforeEach( () => createEditor() );
+		beforeEach( async () => {
+			await createEditor();
 
 
-		beforeEach( () => {
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 
 
 			widget = viewDocument.getRoot().getChild( 1 );
 			widget = viewDocument.getRoot().getChild( 1 );
@@ -560,9 +560,9 @@ describe( 'ImageResize', () => {
 	} );
 	} );
 
 
 	describe( 'table integration', () => {
 	describe( 'table integration', () => {
-		beforeEach( () => createEditor() );
+		beforeEach( async () => {
+			await createEditor();
 
 
-		beforeEach( () => {
 			setData( editor.model,
 			setData( editor.model,
 				'<table>' +
 				'<table>' +
 					`<tableRow><tableCell>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]</tableCell></tableRow>` +
 					`<tableRow><tableCell>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]</tableCell></tableRow>` +
@@ -585,8 +585,6 @@ describe( 'ImageResize', () => {
 	} );
 	} );
 
 
 	describe( 'srcset integration', () => {
 	describe( 'srcset integration', () => {
-		beforeEach( () => createEditor() );
-
 		// The image is 96x96 pixels.
 		// The image is 96x96 pixels.
 		const imageBaseUrl = '/assets/sample.png';
 		const imageBaseUrl = '/assets/sample.png';
 		const getModel = () => editor.model.document.getRoot().getChild( 0 );
 		const getModel = () => editor.model.document.getRoot().getChild( 0 );
@@ -609,7 +607,9 @@ describe( 'ImageResize', () => {
 			}
 			}
 		} );
 		} );
 
 
-		beforeEach( () => {
+		beforeEach( async () => {
+			await createEditor();
+
 			editor.setData(
 			editor.setData(
 				`<figure class="image">
 				`<figure class="image">
 					<img src="${ imageBaseUrl }"
 					<img src="${ imageBaseUrl }"
@@ -710,15 +710,15 @@ describe( 'ImageResize', () => {
 	describe( 'widget toolbar integration', () => {
 	describe( 'widget toolbar integration', () => {
 		let widgetToolbarRepository;
 		let widgetToolbarRepository;
 
 
-		beforeEach( () => createEditor( {
-			plugins: [ Image, ImageStyle, Paragraph, Undo, Table, ImageResize, ImageToolbar, ImageTextAlternative ],
-			image: {
-				toolbar: [ 'imageTextAlternative' ],
-				resizeUnit: 'px'
-			}
-		} ) );
-
 		beforeEach( async () => {
 		beforeEach( async () => {
+			await createEditor( {
+				plugins: [ Image, ImageStyle, Paragraph, Undo, Table, ImageResize, ImageToolbar, ImageTextAlternative ],
+				image: {
+					toolbar: [ 'imageTextAlternative' ],
+					resizeUnit: 'px'
+				}
+			} );
+
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 			setData( editor.model, `<paragraph>foo</paragraph>[<image src="${ IMAGE_SRC_FIXTURE }"></image>]` );
 
 
 			widget = viewDocument.getRoot().getChild( 1 );
 			widget = viewDocument.getRoot().getChild( 1 );