aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-01-24 21:37:05 -0500
committerJohn Resig <jeresig@gmail.com>2010-01-24 21:37:05 -0500
commit6a3d0996edf2f8ba69f62c8c7c3eda07b674d81f (patch)
treec16a10fa87b3faf9e7048cce6fcd86b51ab31e9a /test/unit
parentf06e0e5575bc8f82d0fcbd5880bb9d8ccf361bfa (diff)
downloadjquery-6a3d0996edf2f8ba69f62c8c7c3eda07b674d81f.tar.gz
jquery-6a3d0996edf2f8ba69f62c8c7c3eda07b674d81f.zip
Make sure that XHTML-style HTML is purified in .html(). Fixes #5845.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/manipulation.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 7db8d5bae..16992aeb7 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -793,7 +793,7 @@ test("clone() on XML nodes", function() {
}
var testHtml = function(valueObj) {
- expect(22);
+ expect(24);
jQuery.scriptorder = 0;
@@ -805,6 +805,11 @@ var testHtml = function(valueObj) {
}
ok( pass, "Set HTML" );
+ div = jQuery("<div/>").html( valueObj('<div id="parent_1"><div id="child_1"/></div><div id="parent_2"/>') );
+
+ equals( div.children().length, 2, "Make sure two child nodes exist." );
+ equals( div.children().children().length, 1, "Make sure that a grandchild exists." );
+
reset();
// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();
@@ -1040,4 +1045,4 @@ test("jQuery.cleanData", function() {
return div;
}
-}); \ No newline at end of file
+});