Wordpress/tests/qunit/editor/plugins/jquery_initialization.js
Andrew Ozz 9aba4766fc TinyMCE: update to 4.1.9. Fixes #31551.
git-svn-id: https://develop.svn.wordpress.org/trunk@31700 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-10 19:19:56 +00:00

41 lines
794 B
JavaScript

module("tinymce.plugins.jQueryInitialization", {
setupModule: function() {
document.getElementById('view').innerHTML = (
'<textarea id="elm1"></textarea>' +
'<textarea id="elm2"></textarea>'
);
this.val = $.fn.val;
QUnit.stop();
$(function() {
QUnit.start();
});
},
teardown: function() {
$.fn.val = this.val;
}
});
test("applyPatch is only called once", function() {
expect(1);
var options = {plugins: [
"pagebreak,layer,table,save,emoticons,insertdatetime,preview,media,searchreplace",
"print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,template"
]},
oldValFn;
$('#elm1').tinymce(options);
oldValFn = $.fn.val = function() {
// no-op
};
$('#elm2').tinymce(options);
equal($.fn.val, oldValFn);
});