Sfoglia il codice sorgente

Set buttons as toggleable and add unit test checking it.

Mateusz Samsel 6 anni fa
parent
commit
0bc5f4da64

+ 1 - 0
packages/ckeditor5-link/src/linkui.js

@@ -201,6 +201,7 @@ export default class LinkUI extends Plugin {
 			button.icon = linkIcon;
 			button.keystroke = linkKeystroke;
 			button.tooltip = true;
+			button.isToggleable = true;
 
 			// Bind button to the command.
 			button.bind( 'isOn', 'isEnabled' ).to( linkCommand, 'value', 'isEnabled' );

+ 4 - 0
packages/ckeditor5-link/tests/linkui.js

@@ -85,6 +85,10 @@ describe( 'LinkUI', () => {
 				expect( linkButton ).to.be.instanceOf( ButtonView );
 			} );
 
+			it( 'should be toggleable button', () => {
+				expect( linkButton.isToggleable ).to.be.true;
+			} );
+
 			it( 'should be bound to the link command', () => {
 				const command = editor.commands.get( 'link' );