瀏覽代碼

Set button as toggleable and add unit test checking it.

Mateusz Samsel 6 年之前
父節點
當前提交
46e1000bf6

+ 1 - 0
packages/ckeditor5-paragraph/src/paragraphbuttonui.js

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

+ 1 - 0
packages/ckeditor5-paragraph/tests/paragraphbuttonui.js

@@ -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', () => {