X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fselector.js;h=4c63a7a195add70bcb25efb78c85f873ab2b3263;hb=f38648c7cd3a37f4070b77b2c92151f68aa66fef;hp=11112a5c79e1165cb36b5bc1fc282ec9278d444b;hpb=b438d8391613d4f66f2c2bbaa89b944b93f3c9ee;p=jquery.git diff --git a/test/unit/selector.js b/test/unit/selector.js index 11112a5..4c63a7a 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -56,7 +56,7 @@ test("broken", function() { }); test("id", function() { - expect(25); + expect(27); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); @@ -89,10 +89,13 @@ test("id", function() { t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986 isSet( jQuery("body").find("div#form"), [], "ID selector within the context of another element" ); + + t( "Underscore ID", "#types_all", ["types_all"] ); + t( "Dash ID", "#fx-queue", ["fx-queue"] ); }); test("class", function() { - expect(16); + expect(18); t( "Class Selector", ".blog", ["mark","simon"] ); t( "Class Selector", ".GROUPS", ["groups"] ); t( "Class Selector", ".blog.link", ["simon"] ); @@ -112,6 +115,14 @@ test("class", function() { t( "Descendant scaped Class", "div .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] ); t( "Child escaped Class", "form > .foo\\:bar", ["foo:bar"] ); t( "Child escaped Class", "form > .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] ); + + var div = document.createElement("div"); + div.innerHTML = "
"; + isSet( jQuery(".e", div), [ div.firstChild ], "Finding a second class." ); + + div.lastChild.className = "e"; + + isSet( jQuery(".e", div), [ div.firstChild, div.lastChild ], "Finding a modified class." ); }); test("name", function() { @@ -204,7 +215,7 @@ test("child and adjacent", function() { }); test("attributes", function() { - expect(35); + expect(37); t( "Attribute Exists", "a[title]", ["google"] ); t( "Attribute Exists", "*[title]", ["google"] ); t( "Attribute Exists", "[title]", ["google"] ); @@ -241,6 +252,9 @@ test("attributes", function() { t( "Attribute Ends With", "a[href $= 'org/']", ["mark"] ); t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] ); t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", ["google","groups","anchor1"] ); + + t("Empty values", "#select1 option[value='']", ["option1a"]); + t("Empty values", "#select1 option[value!='']", ["option1b","option1c","option1d"]); t("Select options via :selected", "#select1 option:selected", ["option1a"] ); t("Select options via :selected", "#select2 option:selected", ["option2d"] );