X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=6b2c3fe33f43eb1107f75bbd8ca7f46c3c2888ab;hb=24e036c7c88e7e3a1f878292e4b59914e1f4575c;hp=7ba7eb5da712627e1d4ba74d037d793acd8261ef;hpb=ffbedf0262b3eea906f39c0115b818d7456a3994;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 7ba7eb5..6b2c3fe 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() { @@ -418,7 +420,7 @@ test("css(String|Hash)", function() { }); test("css(String, Object)", function() { - expect(20); + expect(21); ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); $('#foo').css('display', 'none'); ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden'); @@ -452,6 +454,10 @@ test("css(String, Object)", function() { var j = $("#nonnodes").contents(); j.css("padding-left", "1px"); equals( j.css("padding-left"), "1px", "Check node,textnode,comment css works" ); + + // opera sometimes doesn't update 'display' correctly, see #2037 + $("#t2037")[0].innerHTML = $("#t2037")[0].innerHTML + equals( $("#t2037 .hidden").css("display"), "none", "Make sure browser thinks it is hidden" ); }); test("jQuery.css(elem, 'height') doesn't clear radio buttons (bug #1095)", function () { @@ -864,7 +870,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 +878,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 +1038,8 @@ test("html(String)", function() { $("#main").html('foo
'); - $("#main").html("