X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=6efaa84347f581c0b015f03f078cac41938e37c8;hb=609dec9a78ac98e69b67a73989d8437f67c6d33a;hp=7be53f738338d7af3f66338ee6033627445c280f;hpb=76d6d445bb68009c010e0b91dbf21747bc2d35ba;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 7be53f7..6efaa84 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -388,6 +388,25 @@ test("children([String])", function() { isSet( $("#foo").children("[code]").get(), q("sndp", "sap"), "Check for filtered children" ); }); +test("parent[s]([String])", function() { + ok( $("#groups").parent()[0].id == "ap", "Simple parent check" ); + ok( $("#groups").parent("p")[0].id == "ap", "Filtered parent check" ); + ok( $("#groups").parent("div").length == 0, "Filtered parent check, no match" ); + + ok( $("#groups").parents()[0].id == "ap", "Simple parents check" ); + ok( $("#groups").parents("p")[0].id == "ap", "Filtered parents check" ); + ok( $("#groups").parents("div")[0].id == "main", "Filtered parents check2" ); +}); + +test("next/prev([String])", function() { + ok( $("#ap").next()[0].id == "foo", "Simple next check" ); + ok( $("#ap").next("div")[0].id == "foo", "Filtered next check" ); + ok( $("#ap").next("p").length == 0, "Filtered next check, no match" ); + + ok( $("#foo").prev()[0].id == "ap", "Simple prev check" ); + ok( $("#foo").prev("p")[0].id == "ap", "Filtered prev check" ); + ok( $("#foo").prev("div").length == 0, "Filtered prev check, no match" ); +}); test("show()", function() { expect(1); @@ -430,6 +449,7 @@ test("removeClass(String) - add three classes and remove again", function() { }); test("toggleClass(String)", function() { + expect(3); var e = $("#firstp"); ok( !e.is(".test"), "Assert class not present" ); e.toggleClass("test");