Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Other: Aligned the implementation to the new Command API (see https:/…
Browse files Browse the repository at this point in the history
…/github.com/ckeditor/ckeditor5-core/issues/88).

BREAKING CHANGES: The command API has been changed.
  • Loading branch information
szymonkups committed Jun 13, 2017
2 parents 9d1d5e2 + 93373a8 commit 36a976e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/boldengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ export default class BoldEngine extends Plugin {
.toAttribute( BOLD, true );

// Create bold command.
editor.commands.set( BOLD, new ToggleAttributeCommand( editor, BOLD ) );
editor.commands.add( BOLD, new ToggleAttributeCommand( editor, BOLD ) );
}
}
2 changes: 1 addition & 1 deletion src/italicengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ export default class ItalicEngine extends Plugin {
.toAttribute( ITALIC, true );

// Create italic command.
editor.commands.set( ITALIC, new ToggleAttributeCommand( editor, ITALIC ) );
editor.commands.add( ITALIC, new ToggleAttributeCommand( editor, ITALIC ) );
}
}
2 changes: 0 additions & 2 deletions tests/boldengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ describe( 'BoldEngine', () => {

describe( 'command', () => {
it( 'should register bold command', () => {
expect( editor.commands.has( 'bold' ) ).to.be.true;

const command = editor.commands.get( 'bold' );

expect( command ).to.be.instanceOf( ToggleAttributeCommand );
Expand Down
6 changes: 4 additions & 2 deletions tests/italicengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ describe( 'ItalicEngine', () => {
} );
} );

afterEach( () => {
return editor.destroy();
} );

it( 'should be loaded', () => {
expect( editor.plugins.get( ItalicEngine ) ).to.be.instanceOf( ItalicEngine );
} );
Expand All @@ -37,8 +41,6 @@ describe( 'ItalicEngine', () => {

describe( 'command', () => {
it( 'should register italic command', () => {
expect( editor.commands.has( 'italic' ) ).to.be.true;

const command = editor.commands.get( 'italic' );

expect( command ).to.be.instanceOf( ToggleAttributeCommand );
Expand Down

0 comments on commit 36a976e

Please sign in to comment.