diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2014-02-27 03:13:26 +0400 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2014-04-15 17:45:59 +0400 |
commit | d7af36676b89a15ad0571cbf0d2a7d8b93470e58 (patch) | |
tree | ce191ad9a90b05016455808e32df05a6f7adb743 /test | |
parent | 3115d4c92d024ed42c286dc013258ecf684fd6b4 (diff) | |
download | jquery-d7af36676b89a15ad0571cbf0d2a7d8b93470e58.tar.gz jquery-d7af36676b89a15ad0571cbf0d2a7d8b93470e58.zip |
Tests: Add test for selectors with commas
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/selector.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js index 54ee241b9..14d81b79c 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 ); |