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

Commit

Permalink
Set button as toggleable and add unit test checking it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Aug 9, 2019
1 parent aea609b commit 3364aaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/paragraphbuttonui.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default class ParagraphButtonUI extends Plugin {
view.label = t( 'Paragraph' );
view.icon = icon;
view.tooltip = true;
view.isToggleable = true;
view.bind( 'isEnabled' ).to( command );
view.bind( 'isOn' ).to( command, 'value' );

Expand Down
1 change: 1 addition & 0 deletions tests/paragraphbuttonui.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe( 'HeadingButtonUI', () => {
expect( paragraphButton.label ).to.equal( 'Paragraph' );
expect( paragraphButton.icon ).to.equal( icon );
expect( paragraphButton.tooltip ).to.equal( true );
expect( paragraphButton.isToggleable ).to.equal( true );
} );

it( 'should bind button to command', () => {
Expand Down

0 comments on commit 3364aaa

Please sign in to comment.