浏览代码

Add test for cusotm label.

Mateusz Samsel 6 年之前
父节点
当前提交
9cd611b301
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      packages/ckeditor5-widget/tests/widgettoolbarrepository.js

+ 16 - 0
packages/ckeditor5-widget/tests/widgettoolbarrepository.js

@@ -104,6 +104,22 @@ describe( 'WidgetToolbarRepository', () => {
 
 
 			toolbarView.destroy();
 			toolbarView.destroy();
 		} );
 		} );
+
+		it( 'should create custom aria-label if is provided', () => {
+			widgetToolbarRepository.register( 'fake', {
+				items: editor.config.get( 'fake.toolbar' ),
+				getRelatedElement: () => null,
+				ariaLabel: 'Custom label'
+			} );
+
+			const toolbarView = widgetToolbarRepository._toolbarDefinitions.get( 'fake' ).view;
+
+			toolbarView.render();
+
+			expect( toolbarView.element.getAttribute( 'aria-label' ) ).to.equal( 'Custom label' );
+
+			toolbarView.destroy();
+		} );
 	} );
 	} );
 
 
 	describe( 'integration tests', () => {
 	describe( 'integration tests', () => {