X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fselector.js;h=856257f38b8c67316d36582d8c776de16918f925;hb=ee845c49758eeb5236d9e4520b7921e12d5f29b9;hp=04f99d6283ea85dc0bb80b16ee1e1ac807b174b4;hpb=9be7461c3c7e85b1995766533db8806eb0909779;p=jquery.git diff --git a/test/unit/selector.js b/test/unit/selector.js index 04f99d6..856257f 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -36,7 +36,7 @@ test("element", function() { if ( location.protocol != "file:" ) { test("XML Document Selectors", function() { - expect(7); + expect(8); stop(); jQuery.get("data/with_fries.xml", function(xml) { equals( jQuery("foo_bar", xml).length, 1, "Element Selector with underscore" ); @@ -46,6 +46,7 @@ if ( location.protocol != "file:" ) { equals( jQuery("[name=prop2]", xml).length, 1, "Attribute selector with name" ); equals( jQuery("#seite1", xml).length, 1, "Attribute selector with ID" ); equals( jQuery("component#seite1", xml).length, 1, "Attribute selector with ID" ); + equals( jQuery("component", xml).filter("#seite1").length, 1, "Attribute selector filter with ID" ); start(); }); }); @@ -153,7 +154,7 @@ test("class", function() { }); test("name", function() { - expect(14); + expect(15); t( "Name selector", "input[name=action]", ["text1"] ); t( "Name selector with single quotes", "input[name='action']", ["text1"] ); @@ -168,6 +169,12 @@ test("name", function() { same( jQuery("#form").find("input[name=action]").get(), q("text1"), "Name selector within the context of another element" ); same( jQuery("#form").find("input[name='foo[bar]']").get(), q("hidden2"), "Name selector for grouped form element within the context of another element" ); + var form = jQuery("
").appendTo("body"); + + equals( form.find("input").length, 1, "Make sure that rooted queries on forms (with possible expandos) work." ); + + form.remove(); + var a = jQuery('
tName1 AtName2 A
tName1 Div
').appendTo('#main').children(); equals( a.length, 3, "Make sure the right number of elements were inserted." );