});\r
\r
test("add(String|Element|Array|undefined)", function() {\r
- expect(8);\r
+ expect(12);\r
isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );\r
isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );\r
ok( $([]).add($("#form")[0].elements).length >= 13, "Check elements from array" );\r
\r
var notDefined;\r
equals( $([]).add(notDefined).length, 0, "Check that undefined adds nothing" );\r
+ \r
+ // Added after #2811\r
+ equals( $([]).add([window,document,document.body,document]).length, 3, "Pass an array" );\r
+ equals( $(document).add(document).length, 1, "Check duplicated elements" );\r
+ equals( $(window).add(window).length, 1, "Check duplicated elements using the window" );\r
+ ok( $([]).add( document.getElementById('form') ).length >= 13, "Add a form (adds the elements)" );\r
});\r
\r
test("each(Function)", function() {\r
// using contents will get comments regular, text, and comment nodes\r
var j = $("#nonnodes").contents();\r
j.html("<b>bold</b>");\r
+ \r
+ // this is needed, or the expando added by jQuery unique will yield a different html\r
+ j.find('b').removeData(); \r
equals( j.html().toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" );\r
\r
$("#main").html("<select/>");\r
equals( $.makeArray(/a/)[0].constructor, RegExp, "Pass makeArray a regex" );\r
\r
ok( $.makeArray(document.getElementById('form')).length >= 13, "Pass makeArray a form (treat as elements)" );\r
-});
\ No newline at end of file
+});\r