From d7af36676b89a15ad0571cbf0d2a7d8b93470e58 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Thu, 27 Feb 2014 03:13:26 +0400 Subject: [PATCH] Tests: Add test for selectors with commas --- test/unit/selector.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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( "

" ); + + equal( fixture.find( "h2, div p" ).filter( "p" ).length, 2, "has to find two

" ); + equal( fixture.find( "h2, div p" ).filter( "h2" ).length, 1, "has to find one

" ); + equal( fixture.find( "h2 , div p" ).filter( "p" ).length, 2, "has to find two

" ); + equal( fixture.find( "h2 , div p" ).filter( "h2" ).length, 1, "has to find one

" ); +}); + + test("attributes - jQuery only", function() { expect( 5 );