Skip to content
Permalink
Browse files

Assert that .contents().hasClass() works as expected. Fixes #9630

  • Loading branch information...
rwaldron committed Jun 21, 2011
1 parent 96501d3 commit 27e5052a7bd9e8d0af1a94ec2ad0c2c2317c3b50
Showing with 10 additions and 0 deletions.
  1. +10 −0 test/unit/attributes.js
@@ -1055,3 +1055,13 @@ test("addClass, removeClass, hasClass", function() {
jq.removeClass("class4");
ok( jq.hasClass("class4")==false, "Check the class has been properly removed" );
});

test("contents().hasClass() returns correct values", function() {
expect(2);

var $div = jQuery("<div><span class='foo'></span><!-- comment -->text</div>"),
$contents = $div.contents();

ok( $contents.hasClass("foo"), "Found 'foo' in $contents" );
ok( $contents.hasClass("undefined"), "Did not find 'undefined' in $contents (correctly)" );
});

0 comments on commit 27e5052

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