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

Commit 36a976e

Browse files
committed
Other: Aligned the implementation to the new Command API (see https://github.com/ckeditor/ckeditor5-core/issues/88).
BREAKING CHANGES: The command API has been changed.
2 parents 9d1d5e2 + 93373a8 commit 36a976e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Diff for: src/boldengine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ export default class BoldEngine extends Plugin {
4747
.toAttribute( BOLD, true );
4848

4949
// Create bold command.
50-
editor.commands.set( BOLD, new ToggleAttributeCommand( editor, BOLD ) );
50+
editor.commands.add( BOLD, new ToggleAttributeCommand( editor, BOLD ) );
5151
}
5252
}

Diff for: src/italicengine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ export default class ItalicEngine extends Plugin {
4747
.toAttribute( ITALIC, true );
4848

4949
// Create italic command.
50-
editor.commands.set( ITALIC, new ToggleAttributeCommand( editor, ITALIC ) );
50+
editor.commands.add( ITALIC, new ToggleAttributeCommand( editor, ITALIC ) );
5151
}
5252
}

Diff for: tests/boldengine.js

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ describe( 'BoldEngine', () => {
3737

3838
describe( 'command', () => {
3939
it( 'should register bold command', () => {
40-
expect( editor.commands.has( 'bold' ) ).to.be.true;
41-
4240
const command = editor.commands.get( 'bold' );
4341

4442
expect( command ).to.be.instanceOf( ToggleAttributeCommand );

Diff for: tests/italicengine.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ describe( 'ItalicEngine', () => {
2626
} );
2727
} );
2828

29+
afterEach( () => {
30+
return editor.destroy();
31+
} );
32+
2933
it( 'should be loaded', () => {
3034
expect( editor.plugins.get( ItalicEngine ) ).to.be.instanceOf( ItalicEngine );
3135
} );
@@ -37,8 +41,6 @@ describe( 'ItalicEngine', () => {
3741

3842
describe( 'command', () => {
3943
it( 'should register italic command', () => {
40-
expect( editor.commands.has( 'italic' ) ).to.be.true;
41-
4244
const command = editor.commands.get( 'italic' );
4345

4446
expect( command ).to.be.instanceOf( ToggleAttributeCommand );

0 commit comments

Comments
 (0)