X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=a5a59c3a1c0f4de05f654a214bb0ab90f844cb8a;hb=d0fae71464427d9b9e29a5e3fa27729675bef95a;hp=b2cf8f137e8a1cf97373e1359b92e635c06ade81;hpb=c39bd07cc9f408d5680ba565e2a2fe71bbdc64b9;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index b2cf8f1..a5a59c3 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,7 +955,7 @@ test("find(String)", function() { }); test("clone()", function() { - expect(6); + expect(4); 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' ); @@ -958,7 +963,11 @@ test("clone()", function() { // using contents will get comments regular, text, and comment nodes var cl = $("#nonnodes").contents().clone(); ok( cl.length >= 2, "Check node,textnode,comment clone works (some browsers delete comments on clone)" ); +}); +if (!isLocal) { +test("clone() on XML nodes", function() { + expect(2); stop(); $.get("data/dashboard.xml", function (xml) { var root = $(xml.documentElement).clone(); @@ -969,6 +978,7 @@ test("clone()", function() { start(); }); }); +} test("is(String)", function() { expect(26);