浏览代码

Tests: Adjusted manual test to last changes in BlockToolbar.

Oskar Wróbel 7 年之前
父节点
当前提交
373ef6c870

+ 0 - 5
packages/ckeditor5-ui/tests/manual/blocktoolbar/blocktoolbar.html

@@ -21,11 +21,6 @@
 			You learn to appreciate each and every single one of the differences while you become more culturally fluid.
 		</p>
 
-		<blockquote>
-			<p>The real voyage of discovery consists not in seeking new landscapes, but having new eyes.</p>
-			<p><strong>Marcel Proust</strong></p>
-		</blockquote>
-
 		<h3>Improvisation</h3>
 		<p>
 			Life doesn't allow us to execute every single plan perfectly. This especially seems to be the case when

+ 7 - 19
packages/ckeditor5-ui/tests/manual/blocktoolbar/blocktoolbar.js

@@ -6,34 +6,22 @@
 /* globals window, document, console:false, setTimeout */
 
 import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
-import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
+import List from '@ckeditor/ckeditor5-list/src/list';
+import Image from '@ckeditor/ckeditor5-image/src/image';
+import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import Heading from '@ckeditor/ckeditor5-heading/src/heading';
 import HeadingButtonsUI from '@ckeditor/ckeditor5-heading/src/headingbuttonsui';
 import ParagraphButtonUI from '@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui';
-import BalloonToolbar from '../../../src/toolbar/balloon/balloontoolbar';
 import BlockToolbar from '../../../src/toolbar/block/blocktoolbar';
 
 import Position from '@ckeditor/ckeditor5-engine/src/model/position';
 import Range from '@ckeditor/ckeditor5-engine/src/model/range';
 
-class CustomBlockToolbar extends BlockToolbar {
-	init() {
-		super.init();
-
-		this.on( 'checkAllowed', ( evt, args ) => {
-			const modelElement = args[ 0 ];
-
-			if ( modelElement && modelElement.name === 'heading1' ) {
-				evt.return = false;
-			}
-		} );
-	}
-}
-
 BalloonEditor
 	.create( document.querySelector( '#editor' ), {
-		plugins: [ ArticlePluginSet, HeadingButtonsUI, ParagraphButtonUI, BalloonToolbar, CustomBlockToolbar ],
-		balloonToolbar: [ 'bold', 'italic', 'link' ],
-		blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', 'bulletedList', 'numberedList', 'blockQuote' ]
+		plugins: [ List, Paragraph, Heading, Image, ImageCaption, HeadingButtonsUI, ParagraphButtonUI, BlockToolbar ],
+		blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', 'bulletedList', 'numberedList' ]
 	} )
 	.then( editor => {
 		window.editor = editor;

+ 1 - 1
packages/ckeditor5-ui/tests/manual/blocktoolbar/blocktoolbar.md

@@ -1,6 +1,6 @@
 ## Block toolbar demo
 
-1. Check if button appears next to all block elements except image (default) and heading1 (custom).
+1. Check if button appears next to all block elements except image (no toolbar item available).
 2. Change format of one of the block elements, panel attached to button should hide after that.
 3. Put selection in the one of the last blocks, click on button to display panel then start resize browser window
 and observe if button and panel are properly repositioned.