From: <com...@fc...> - 2011-03-03 12:46:05
|
Author: krst Date: 2011-03-03 13:46:45 +0100 (Thu, 03 Mar 2011) New Revision: 6517 Added: CKEditor/tests/tt/7019/ CKEditor/tests/tt/7019/1.html Log: Added ticket test to #7019 Added: CKEditor/tests/tt/7019/1.html =================================================================== --- CKEditor/tests/tt/7019/1.html (rev 0) +++ CKEditor/tests/tt/7019/1.html 2011-03-03 12:46:45 UTC (rev 6517) @@ -0,0 +1,66 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title>Ticket: #7019 - Selection across input elements</title> + <meta name="tags" content="editor,unit,all"> + <script type="text/javascript" src="../../cktester/cell.js"></script> + <script> +( function() +{ + var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test, selector = YAHOO.util.Selector; + + YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite( + { + editorName : 'test_editor_1', + name :document.title + } ) ); + + ts.add( tc = new YAHOO.tool.TestCase( + { + setUp : function () + { + // Force result data un-formatted. + ts.editor.dataProcessor.writer._.rules = {}; + ts.editor.focus(); + + }, + + test_selection_bold: function() + { + var editor = ts.editor, + contentWithSelection = test.getValueAsHtml( 'input' ); + + test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection ); + + editor.execCommand( 'bold' ); + assert.areSame( '<p>te<strong>xt<input type="text" />te</strong>xt </p>', editor.getData() ); + }, + + test_selection_replace_with_hr: function() + { + var editor = ts.editor, + contentWithSelection = test.getValueAsHtml( 'input_1' ); + + test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection ); + + editor.execCommand( 'horizontalrule' ); + this.wait( function () + { + assert.areSame( '<p>te</p><hr /><p>xt</p>', editor.getData() ); + }, 1000 ); + }, + } ) ); +} )(); + </script> +</head> +<body> +<textarea id='input'> +te[xt<input type="text" />te]xt +</textarea> +<textarea id='input_1'> +te[xt<input type="text" />te]xt +</textarea> +</body> +</html> + |