Browse Source

Other: Remove silent validation in commands.

Maciej Gołaszewski 7 years ago
parent
commit
f8e7fe31aa

+ 1 - 5
packages/ckeditor5-image/src/imagestyle/imagestylecommand.js

@@ -78,13 +78,9 @@ export default class ImageStyleCommand extends Command {
 	 * {@link module:image/image~ImageConfig#styles `image.styles`} configuration option).
 	 * @fires execute
 	 */
-	execute( options = {} ) {
+	execute( options ) {
 		const styleName = options.value;
 
-		if ( !this.styles[ styleName ] ) {
-			return;
-		}
-
 		const model = this.editor.model;
 		const imageElement = model.document.selection.getSelectedElement();
 

+ 0 - 16
packages/ckeditor5-image/tests/imagestyle/imagestylecommand.js

@@ -70,22 +70,6 @@ describe( 'ImageStyleCommand', () => {
 		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
 	} );
 
-	it( 'should do nothing attribute is not known', () => {
-		setData( model, '[<image imageStyle="otherStyle"></image>]' );
-
-		command.execute( { value: 'someNotExistingStyle' } );
-
-		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
-	} );
-
-	it( 'should do nothing when value is not passed', () => {
-		setData( model, '[<image imageStyle="otherStyle"></image>]' );
-
-		command.execute();
-
-		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
-	} );
-
 	it( 'should use parent batch', () => {
 		setData( model, '[<image></image>]' );