X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=03f89d1cc098cd2d0b474e2052da4f06656933d4;hb=14a3a5bf9d65d9910a730d53208e3dccb34e3704;hp=533fcef2d0637529ba835ec70a3f55417e0ba3eb;hpb=b3ec8edddd9261eef490f8317144e9c68c888819;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 533fcef..03f89d1 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -152,7 +152,7 @@ test("isFunction", function() { var foo = false; test("$('html')", function() { - expect(5); + expect(6); reset(); foo = false; @@ -169,6 +169,8 @@ test("$('html')", function() { var j = $("hi there "); ok( j.length >= 2, "Check node,textnode,comment creation (some browsers delete comments)" ); + + ok( !$("")[0].selected, "Make sure that options are auto-selected #2050" ); }); test("$('html', context)", function() { @@ -864,7 +866,7 @@ test("find(String)", function() { }); test("clone()", function() { - expect(4); + expect(6); 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' ); @@ -872,6 +874,16 @@ 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)" ); + + stop(); + $.get("data/dashboard.xml", function (xml) { + var root = $(xml.documentElement).clone(); + $("tab:first", xml).text("origval"); + $("tab:first", root).text("cloneval"); + equals($("tab:first", xml).text(), "origval", "Check original XML node was correctly set"); + equals($("tab:first", root).text(), "cloneval", "Check cloned XML node was correctly set"); + start(); + }); }); test("is(String)", function() { @@ -1022,7 +1034,8 @@ test("html(String)", function() { $("#main").html('foo
'); - $("#main").html("