浏览代码

Set buttons as toggleable and add unit test checking it.

Mateusz Samsel 6 年之前
父节点
当前提交
0bc5f4da64
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      packages/ckeditor5-link/src/linkui.js
  2. 4 0
      packages/ckeditor5-link/tests/linkui.js

+ 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' );