Przeglądaj źródła

Set buttons as toggleable and add unit test to check it.

Mateusz Samsel 6 lat temu
rodzic
commit
19a235d528

+ 2 - 1
packages/ckeditor5-list/src/listui.js

@@ -49,7 +49,8 @@ export default class ListUI extends Plugin {
 			buttonView.set( {
 				label,
 				icon,
-				tooltip: true
+				tooltip: true,
+				isToggleable: true
 			} );
 
 			// Bind button model to command.

+ 3 - 0
packages/ckeditor5-list/tests/listui.js

@@ -41,7 +41,10 @@ describe( 'ListUI', () => {
 
 	it( 'should set up buttons for bulleted list and numbered list', () => {
 		expect( bulletedListButton ).to.be.instanceOf( ButtonView );
+		expect( bulletedListButton.isToggleable ).to.be.true;
+
 		expect( numberedListButton ).to.be.instanceOf( ButtonView );
+		expect( numberedListButton.isToggleable ).to.be.true;
 	} );
 
 	it( 'should execute proper commands when buttons are used', () => {