浏览代码

Tests: Included the heading[4,5,6] UI components in heading buttons tests.

Aleksander Nowodzinski 7 年之前
父节点
当前提交
fcf006f828

+ 15 - 1
packages/ckeditor5-heading/tests/headingbuttonsui.js

@@ -24,7 +24,18 @@ describe( 'HeadingButtonUI', () => {
 			return ClassicTestEditor
 				.create( editorElement, {
 					plugins: [ HeadingButtonsUI, HeadingEditing ],
-					toolbar: [ 'heading1', 'heading2', 'heading3' ]
+					toolbar: [ 'heading1', 'heading2', 'heading3', 'heading3' ],
+					heading: {
+						options: [
+							{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
+							{ model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
+							{ model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
+							{ model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' },
+							{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' },
+							{ model: 'heading5', view: 'h6', title: 'Heading 5', class: 'ck-heading_heading5' },
+							{ model: 'heading6', view: 'p', title: 'Heading 6', class: 'ck-heading_heading6' }
+						]
+					}
 				} )
 				.then( newEditor => {
 					editor = newEditor;
@@ -46,6 +57,9 @@ describe( 'HeadingButtonUI', () => {
 			expect( factory.create( 'heading1' ) ).to.be.instanceOf( ButtonView );
 			expect( factory.create( 'heading2' ) ).to.be.instanceOf( ButtonView );
 			expect( factory.create( 'heading3' ) ).to.be.instanceOf( ButtonView );
+			expect( factory.create( 'heading4' ) ).to.be.instanceOf( ButtonView );
+			expect( factory.create( 'heading5' ) ).to.be.instanceOf( ButtonView );
+			expect( factory.create( 'heading6' ) ).to.be.instanceOf( ButtonView );
 		} );
 
 		it( 'should intialize buttons with correct localized data', () => {

+ 12 - 1
packages/ckeditor5-heading/tests/manual/heading-buttons.js

@@ -17,7 +17,18 @@ import Undo from '@ckeditor/ckeditor5-undo/src/undo';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Enter, Typing, Undo, Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ],
-		toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', '|', 'undo', 'redo' ]
+		toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6', '|', 'undo', 'redo' ],
+		heading: {
+			options: [
+				{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
+				{ model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
+				{ model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
+				{ model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' },
+				{ model: 'heading4', view: 'h5', title: 'Heading 4', class: 'ck-heading_heading4' },
+				{ model: 'heading5', view: 'h6', title: 'Heading 5', class: 'ck-heading_heading5' },
+				{ model: 'heading6', view: 'p', title: 'Heading 6', class: 'ck-heading_heading6' }
+			]
+		}
 	} )
 	.then( editor => {
 		window.editor = editor;