Skip to content
Permalink
Browse files

Tests: Add test for selectors with commas

  • Loading branch information
markelog committed Feb 26, 2014
1 parent 3115d4c commit d7af36676b89a15ad0571cbf0d2a7d8b93470e58
Showing with 12 additions and 0 deletions.
  1. +12 −0 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 );

0 comments on commit d7af366

Please sign in to comment.
You can’t perform that action at this time.