浏览代码

Tests: Improved tests description and simplified the code to run the editor.

Aleksander Nowodzinski 8 年之前
父节点
当前提交
d584c06420

+ 1 - 1
packages/ckeditor5-core/tests/manual/formsubmit.html

@@ -8,7 +8,7 @@
 </style>
 
 <form id="form" action="http://localhost/" method="post">
-	<p>Replaced element (normally hidden): </p>
+	<p>Editor textarea element (normally hidden): </p>
 	<textarea name="editor" id="editor"><p>foo bar baz</p></textarea>
 	<button type="submit">Submit form</button>
 </form>

+ 4 - 5
packages/ckeditor5-core/tests/manual/formsubmit.js

@@ -14,16 +14,15 @@ document.getElementById( 'form' ).submit = () => {};
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ ArticlePreset ],
-		toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],
-		image: {
-			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ],
-		}
+		toolbar: [ 'bold', 'italic', 'undo', 'redo' ],
 	} )
 	.then( editor => {
 		window.editor = editor;
 		const form = document.getElementById( 'form' );
 
-		document.getElementById( 'submit-with-js' ).addEventListener( 'click', () => form.submit() );
+		document.getElementById( 'submit-with-js' ).addEventListener( 'click', () => {
+			form.submit();
+		} );
 
 		form.addEventListener( 'submit', evt => {
 			evt.preventDefault();

+ 2 - 2
packages/ckeditor5-core/tests/manual/formsubmit.md

@@ -1,4 +1,4 @@
 ## Updating editor element when submitting a form
 
-1. Change editor's contents and press `Submit form` button. Check if contents inside replaced element are updated.
-1. Change editor contents again and press `Submit by calling form.submit()` button. Check if contents inside replaced element are updated.
+1. Change the content of the editor and press the "Submit form" button. Check if the content of the editor element has been updated.
+1. Change the content of the editor again and press "Submit by calling form.submit()" button. Check if the content of the editor element has been updated.