8
0
Просмотр исходного кода

Tests: Extended the manual test with inputs and their states.

Aleksander Nowodzinski 8 лет назад
Родитель
Сommit
19885875c1

+ 10 - 0
packages/ckeditor5-theme-lark/tests/manual/theme.html

@@ -94,3 +94,13 @@
 
 	<h3>Toolbar: Multi-row</h3>
 	<div id="toolbar-multi-row" class="ck-reset_all"></div>
+
+<hr/>
+
+<h2>Inputs</h2>
+
+	<h3>Labeled</h3>
+	<div id="input-labeled" class="ck-reset_all"></div>
+
+	<h3>Disabled</h3>
+	<div id="input-disabled" class="ck-reset_all"></div>

+ 28 - 1
packages/ckeditor5-theme-lark/tests/manual/theme.js

@@ -17,6 +17,8 @@ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import createListDropdown from '@ckeditor/ckeditor5-ui/src/dropdown/list/createlistdropdown';
 import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview';
 import ToolbarSeparatorView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview';
+import InputTextView from '@ckeditor/ckeditor5-ui/src/inputtext/inputtextview';
+import LabeledInputView from '@ckeditor/ckeditor5-ui/src/labeledinput/labeledinputview';
 
 import boldIcon from '@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg';
 import italicIcon from '@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg';
@@ -67,13 +69,17 @@ const ui = testUtils.createTestUIView( {
 	'toolbarRounded': '#toolbar-rounded',
 	'toolbarWrap': '#toolbar-wrap',
 	'toolbarSeparator': '#toolbar-separator',
-	'toolbarMultiRow': '#toolbar-multi-row'
+	'toolbarMultiRow': '#toolbar-multi-row',
+
+	'inputLabeled': '#input-labeled',
+	'inputDisabled': '#input-disabled'
 } );
 
 renderIcon();
 renderButton();
 renderDropdown();
 renderToolbar();
+renderInput();
 
 function renderIcon() {
 	// --- In-text ------------------------------------------------------------
@@ -301,6 +307,15 @@ function renderToolbar() {
 	] ) );
 }
 
+function renderInput() {
+	ui.inputLabeled.add( input() );
+	ui.inputDisabled.add( input( {
+		label: 'A disabled input',
+		isEnabled: false,
+		value: 'Disabled input value'
+	} ) );
+}
+
 function text() {
 	return new TextView();
 }
@@ -355,3 +370,15 @@ function toolbarSeparator() {
 function toolbarNewLine() {
 	return new ToolbarNewlineView();
 }
+
+function input( {
+	label = 'Labeled input',
+	isEnabled = true,
+	value = 'The value of the input'
+} = {} ) {
+	const labeledInput = new LabeledInputView( {}, InputTextView );
+
+	labeledInput.set( { isEnabled, label, value } );
+
+	return labeledInput;
+}