});
test("addClass, removeClass, hasClass", function() {
- expect(14);
+ expect(17);
var jq = jQuery("<p>Hi</p>"), x = jq[0];
ok( jq.hasClass("hi"), "Check has1" );
ok( jq.hasClass("bar"), "Check has2" );
- var jq = jQuery("<p class='class1\nclass2\tcla.ss3\n'></p>");
- ok( jq.hasClass("class1"), "Check hasClass with carriage return" );
- ok( jq.is(".class1"), "Check is with carriage return" );
+ var jq = jQuery("<p class='class1\nclass2\tcla.ss3\n\rclass4'></p>");
+ ok( jq.hasClass("class1"), "Check hasClass with line feed" );
+ ok( jq.is(".class1"), "Check is with line feed" );
ok( jq.hasClass("class2"), "Check hasClass with tab" );
ok( jq.is(".class2"), "Check is with tab" );
ok( jq.hasClass("cla.ss3"), "Check hasClass with dot" );
+ ok( jq.hasClass("class4"), "Check hasClass with carriage return" );
+ ok( jq.is(".class4"), "Check is with carriage return" );
jq.removeClass("class2");
ok( jq.hasClass("class2")==false, "Check the class has been properly removed" );
ok( jq.hasClass("cla.ss3"), "Check the dotted class has not been removed" );
jq.removeClass("cla.ss3");
ok( jq.hasClass("cla.ss3")==false, "Check the dotted class has been removed" );
+ jq.removeClass("class4");
+ ok( jq.hasClass("class4")==false, "Check the class has been properly removed" );
});