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 #266 from ckeditor/t/261
Browse files Browse the repository at this point in the history
Other: Remove `ImageEditing` plugin from requires method of `ImageStyleEditing`. Closes #261.
  • Loading branch information
f1ames authored Jan 3, 2019
2 parents 18e643a + 976f494 commit 5dea054
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/imagestyle/imagestyleediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ImageStyleCommand from './imagestylecommand';
import ImageEditing from '../image/imageediting';
import { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters';
import { normalizeImageStyles } from './utils';

Expand All @@ -20,13 +19,6 @@ import { normalizeImageStyles } from './utils';
* @extends {module:core/plugin~Plugin}
*/
export default class ImageStyleEditing extends Plugin {
/**
* @inheritDoc
*/
static get requires() {
return [ ImageEditing ];
}

/**
* @inheritDoc
*/
Expand Down
3 changes: 2 additions & 1 deletion tests/imagestyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
import Image from '../src/image';
import ImageStyle from '../src/imagestyle';
import ImageStyleEditing from '../src/imagestyle/imagestyleediting';
import ImageStyleUI from '../src/imagestyle/imagestyleui';
Expand All @@ -18,7 +19,7 @@ describe( 'ImageStyle', () => {

return ClassicTestEditor
.create( editorElement, {
plugins: [ ImageStyle ]
plugins: [ Image, ImageStyle ]
} )
.then( newEditor => {
editor = newEditor;
Expand Down
16 changes: 6 additions & 10 deletions tests/imagestyle/imagestyleediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe( 'ImageStyleEditing', () => {
beforeEach( () => {
return VirtualTestEditor
.create( {
plugins: [ ImageStyleEditing ],
plugins: [ ImageEditing, ImageStyleEditing ]
} )
.then( newEditor => {
editor = newEditor;
Expand All @@ -42,17 +42,13 @@ describe( 'ImageStyleEditing', () => {
it( 'should be loaded', () => {
expect( editor.plugins.get( ImageStyleEditing ) ).to.be.instanceOf( ImageStyleEditing );
} );

it( 'should load image editing', () => {
expect( editor.plugins.get( ImageEditing ) ).to.be.instanceOf( ImageEditing );
} );
} );

describe( 'init', () => {
beforeEach( () => {
return VirtualTestEditor
.create( {
plugins: [ ImageStyleEditing ],
plugins: [ ImageEditing, ImageStyleEditing ],
image: {
styles: [
{ name: 'fullStyle', title: 'foo', icon: 'object-center', isDefault: true },
Expand All @@ -72,7 +68,7 @@ describe( 'ImageStyleEditing', () => {
it( 'should define image.styles config', () => {
return VirtualTestEditor
.create( {
plugins: [ ImageStyleEditing ]
plugins: [ ImageEditing, ImageStyleEditing ]
} )
.then( newEditor => {
editor = newEditor;
Expand Down Expand Up @@ -265,7 +261,7 @@ describe( 'ImageStyleEditing', () => {
it( 'should fall back to defaults when no image.styles', () => {
return VirtualTestEditor
.create( {
plugins: [ ImageStyleEditing ]
plugins: [ ImageEditing, ImageStyleEditing ]
} )
.then( newEditor => {
editor = newEditor;
Expand All @@ -277,7 +273,7 @@ describe( 'ImageStyleEditing', () => {
it( 'should not alter the image.styles config', () => {
return VirtualTestEditor
.create( {
plugins: [ ImageStyleEditing ],
plugins: [ ImageEditing, ImageStyleEditing ],
image: {
styles: [
'side'
Expand All @@ -294,7 +290,7 @@ describe( 'ImageStyleEditing', () => {
it( 'should not alter object definitions in the image.styles config', () => {
return VirtualTestEditor
.create( {
plugins: [ ImageStyleEditing ],
plugins: [ ImageEditing, ImageStyleEditing ],
image: {
styles: [
{ name: 'side' }
Expand Down
7 changes: 4 additions & 3 deletions tests/imagestyle/imagestyleui.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
import ImageStyleEditing from '../../src/imagestyle/imagestyleediting';
import ImageStyleUI from '../../src/imagestyle/imagestyleui';
import ImageEditing from '../../src/image/imageediting';
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
Expand All @@ -26,7 +27,7 @@ describe( 'ImageStyleUI', () => {

return ClassicTestEditor
.create( editorElement, {
plugins: [ ImageStyleEditing, ImageStyleUI ],
plugins: [ ImageEditing, ImageStyleEditing, ImageStyleUI ],
image: {
styles
}
Expand Down Expand Up @@ -77,7 +78,7 @@ describe( 'ImageStyleUI', () => {

return ClassicTestEditor
.create( editorElement, {
plugins: [ TranslationMock, ImageStyleEditing, ImageStyleUI ],
plugins: [ TranslationMock, ImageEditing, ImageStyleEditing, ImageStyleUI ],
image: {
styles: [
{ name: 'style 1', title: 'Side image', icon: 'style1-icon', isDefault: true }
Expand All @@ -99,7 +100,7 @@ describe( 'ImageStyleUI', () => {

return ClassicTestEditor
.create( editorElement, {
plugins: [ ImageStyleEditing, ImageStyleUI ],
plugins: [ ImageEditing, ImageStyleEditing, ImageStyleUI ],
image: {
styles,
toolbar: [ 'foo', 'bar' ]
Expand Down

0 comments on commit 5dea054

Please sign in to comment.