diff --git a/_test/import.js b/_test/import.js index 84a404095..e7f5825bd 100644 --- a/_test/import.js +++ b/_test/import.js @@ -20,6 +20,7 @@ ///import core/localstorage; ///import plugins/defaultfilter; ///import plugins/inserthtml; +///import plugins/insertfile; ///import plugins/autotypeset; ///import plugins/background; ///import plugins/image; @@ -59,6 +60,7 @@ ///import plugins/autolink; ///import plugins/autoheight; ///import plugins/autofloat; +///import plugins/autosubmit; ///import plugins/video; ///import plugins/table.core; ///import plugins/table.cmds; diff --git a/_test/plugins/autosubmit.js b/_test/plugins/autosubmit.js new file mode 100644 index 000000000..c78fd5e91 --- /dev/null +++ b/_test/plugins/autosubmit.js @@ -0,0 +1,41 @@ +/** + * Created by wangrui10 on 14-6-4. + */ +module('plugins.autosubmit'); + +test("自动提交",function(){ + var form = document.body.appendChild(document.createElement('form')); + form.id = 'formid'; + form.action = './'; + form.method = "post"; + form.target = '_blank'; + + var text = document.createElement('input'); + text.type = 'text'; + form.appendChild(text); + + var btn = document.createElement('input'); + btn.type = 'submit'; + form.appendChild(btn); + + var div = form.appendChild(document.createElement('div')); + div.id = 'ue'; + var editor = UE.getEditor('ue'); + editor.ready(function(){ + editor.body.innerHTML='123123'; + editor.focus(); + editor.execCommand('autosubmit'); + + form = domUtils.findParentByTagName(this.iframe,"form", false); + + setTimeout(function(){ + equal(editor.textarea.value,'123123','检查editor中准备同步的内容'); + var d = $('#'+form.id).context.forms.formid[2].value; + equal(d,'123123','editor中的内容同步到textarea中'); + start(); + },100); + + }); + stop(); +}); + diff --git a/_test/plugins/defaultfilter.js b/_test/plugins/defaultfilter.js index 95425bdd2..0809dda99 100644 --- a/_test/plugins/defaultfilter.js +++ b/_test/plugins/defaultfilter.js @@ -10,6 +10,14 @@ module( 'plugins.defaultfilter' ); //test('',function(){ // stop(); //}); +test( 'p标签禁止嵌套', function () { + var editor = te.obj[0]; + editor.setContent( '

123

456

' ); + var br = ua.browser.ie?' ':'
'; + console.log(editor.getContent()); + var html = '

'+br+'

123

456

'; + ua.checkSameHtml(editor.body.innerHTML,html, 'p标签禁止嵌套'); +} ); test( '对代码的行号不处理', function () { var editor = te.obj[0]; editor.setContent( '
1
2
'); diff --git a/_test/plugins/insertcode.js b/_test/plugins/insertcode.js index 4098c526e..605ab7fb7 100644 --- a/_test/plugins/insertcode.js +++ b/_test/plugins/insertcode.js @@ -70,6 +70,20 @@ test('trace 3395:插入代码为空时,清空编辑器', function () { ua.keydown(editor.body, {'keyCode':8}); br = ua.browser.ie ? '' : '
'; ua.checkSameHtml(editor.body.innerHTML, '

' + br + '

', '检查编辑器清空'); + + if(!ua.browser.ie){ + editor.setContent('
');
+        editor.fireEvent('delkeydown',{});
+        ua.checkSameHtml(editor.body.innerHTML, '

' + br + '

', '检查编辑器清空'); + } + editor.setContent('
');
+        ua.keydown(editor.body, {'keyCode':40});
+
+        if(ua.browser.ie==8||ua.browser.ie==11)
+            br = '
' + if(ua.browser.ie==8)return; + ua.checkSameHtml(editor.body.innerHTML,'
'+br+'
','方向键处理'); + }); test('trace 3396:多次切换源码,不会产生空行', function () {