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

Commit

Permalink
Set buttons as toggleable and update test to check it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Aug 12, 2019
1 parent 0c2124f commit 221a496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/imagestyle/imagestyleui.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export default class ImageStyleUI extends Plugin {
view.set( {
label: style.title,
icon: style.icon,
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isEnabled' ).to( command, 'isEnabled' );
Expand Down
1 change: 1 addition & 0 deletions tests/imagestyle/imagestyleui.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe( 'ImageStyleUI', () => {
expect( buttonView ).to.be.instanceOf( ButtonView );
expect( buttonView.label ).to.equal( style.title );
expect( buttonView.icon ).to.equal( style.icon );
expect( buttonView.isToggleable ).to.be.true;

command.isEnabled = true;
expect( buttonView.isEnabled ).to.be.true;
Expand Down

0 comments on commit 221a496

Please sign in to comment.