X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=12b405644ac4dc2c6b5ce8b4d6575d214e13d664;hb=da33a981c6fb18a195377d55a6d243e2de887f45;hp=3aa66b32461229e8e661c7c41ebeea06bc072049;hpb=9ea8017f86c48ab624fbdc0e55a79110d9c61a9f;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 3aa66b3..12b4056 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -864,7 +864,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 +872,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() { @@ -1042,10 +1052,12 @@ test("filter()", function() { }); test("not()", function() { - expect(3); + expect(5); ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" ); + isSet( $("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" ); isSet( $("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" ); isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" ); + isSet( $("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d" ), "not('complex selector')"); }); test("andSelf()", function() {