aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2014-02-27 03:13:26 +0400
committerOleg Gaidarenko <markelog@gmail.com>2014-04-15 17:46:25 +0400
commit510c002ff70a6cbc293c917fa322ba61c94794fd (patch)
tree20133a4b44ad50671e758dc75664278453b5d977 /test/unit
parent1c596165bce5bfa2db9d1e69ef8b1625767b2f6b (diff)
downloadjquery-510c002ff70a6cbc293c917fa322ba61c94794fd.tar.gz
jquery-510c002ff70a6cbc293c917fa322ba61c94794fd.zip
Tests: Add test for selectors with commas
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/selector.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js
index e5e3185ae..6236b5d6d 100644
--- a/test/unit/selector.js
+++ b/test/unit/selector.js
@@ -89,6 +89,18 @@ test("name", function() {
form.remove();
});
+test( "comma selectors", function() {
+ expect( 4 );
+
+ var fixture = jQuery( "<div><h2><span/></h2><div><p><span/></p><p/></div></div>" );
+
+ equal( fixture.find( "h2, div p" ).filter( "p" ).length, 2, "has to find two <p>" );
+ equal( fixture.find( "h2, div p" ).filter( "h2" ).length, 1, "has to find one <h2>" );
+ equal( fixture.find( "h2 , div p" ).filter( "p" ).length, 2, "has to find two <p>" );
+ equal( fixture.find( "h2 , div p" ).filter( "h2" ).length, 1, "has to find one <h2>" );
+});
+
+
test("attributes - jQuery only", function() {
expect( 5 );