X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fselector.js;h=9f3fb6f2c0f6598e6abf8c7b6ff57d16bf489c02;hb=291f071eff51bc0653aaf3dcfd777cc57437ebdf;hp=2c80d796c83b7004ddf771459dc2c44bae880906;hpb=084079d2fd1c7ed3582612cc32b01346b43fb415;p=jquery.git diff --git a/test/unit/selector.js b/test/unit/selector.js index 2c80d79..9f3fb6f 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -59,8 +59,8 @@ test("id", function() { t( "Child escaped ID", "form > #foo\\:bar", ["foo:bar"] ); t( "Child escaped ID", "form > #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] ); - t( "ID Selector, child ID present", "#form > #radio1", ["radio1"] ); // bug #267 - t( "ID Selector, not an ancestor ID", "#form #first", [] ); + t( "ID Selector, child ID present", "#form > #radio1", ["radio1"] ); // bug #267 + t( "ID Selector, not an ancestor ID", "#form #first", [] ); t( "ID Selector, not a child ID", "#form > #option1a", [] ); t( "All Children of ID", "#foo > *", ["sndp", "en", "sap"] ); @@ -182,7 +182,7 @@ test("attributes", function() { }); test("pseudo (:) selectors", function() { - expect(32); + expect(35); t( "First Child", "p:first-child", ["firstp","sndp"] ); t( "Last Child", "p:last-child", ["sap"] ); t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] ); @@ -193,8 +193,11 @@ test("pseudo (:) selectors", function() { t( "Selected Option Element", "#form option:selected", ["option1a","option2d","option3b","option3c"] ); t( "Text Contains", "a:contains('Google')", ["google","groups"] ); t( "Text Contains", "a:contains('Google Groups')", ["groups"] ); - t( "Element Preceded By", "p ~ div", ["foo","fx-queue","fx-tests"] ); + t( "Element Preceded By", "p ~ div", ["foo","fx-queue","fx-tests", "moretests"] ); t( "Not", "a.blog:not(.link)", ["mark"] ); + t( "Not - multiple", "#form option:not(:contains('Nothing'),#option1b,:selected)", ["option1c", "option1d", "option2b", "option2c", "option3d"] ); + t( "Not - complex", "#form option:not([id^='opt']:gt(0):nth-child(-n+3))", [ "option1a", "option1d", "option2d", "option3d"] ); + t( "Not - recursive", "#form option:not(:not(:selected))[id^='option3']", [ "option3b", "option3c"] ); t( "nth Element", "p:nth(1)", ["ap"] ); t( "First Element", "p:first", ["firstp"] );