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

This commit is contained in:
rwldrn 2011-06-21 14:04:06 -04:00
parent 96501d38a9
commit 27e5052a7b

View File

@ -1055,3 +1055,13 @@ test("addClass, removeClass, hasClass", function() {
jq.removeClass("class4"); jq.removeClass("class4");
ok( jq.hasClass("class4")==false, "Check the class has been properly removed" ); 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)" );
});