X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=3cb90aa7886b7be41fa13f487b7764151164faa5;hb=b0c7df65d0f92b77752e8f9b33898d0e3b2c05e8;hp=b2cf8f137e8a1cf97373e1359b92e635c06ade81;hpb=c39bd07cc9f408d5680ba565e2a2fe71bbdc64b9;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index b2cf8f1..3cb90aa 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -217,6 +217,7 @@ test("$('html', context)", function() { equals($span.length, 1, "Verify a span created with a div context works, #1763"); }); +if ( !isLocal ) { test("$(selector, xml).text(str) - Loaded via XML document", function() { expect(2); stop(); @@ -228,6 +229,7 @@ test("$(selector, xml).text(str) - Loaded via XML document", function() { start(); }); }); +} test("length", function() { expect(1); @@ -250,11 +252,14 @@ test("get(Number)", function() { }); test("add(String|Element|Array|undefined)", function() { - expect(9); + expect(8); isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" ); ok( $([]).add($("#form")[0].elements).length >= 13, "Check elements from array" ); - equals( $([]).add($("#form")[0].elements).length, $($("#form")[0].elements).length, "Array in constructor must equals array in add()" ); + + // For the time being, we're discontinuing support for $(form.elements) since it's ambiguous in IE + // use $([]).add(form.elements) instead. + //equals( $([]).add($("#form")[0].elements).length, $($("#form")[0].elements).length, "Array in constructor must equals array in add()" ); var x = $([]).add($("

xxx

")).add($("

xxx

")); ok( x[0].id == "x1", "Check on-the-fly element1" ); @@ -950,15 +955,31 @@ test("find(String)", function() { }); test("clone()", function() { - expect(6); + expect(20); ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Assert text for #en' ); var clone = $('#yahoo').clone(); ok( 'Try them out:Yahoo' == $('#first').append(clone).text(), 'Check for clone' ); ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' ); + + var cloneTags = [ + "", "", "
", "
", + "