Commit 37394598 authored by Ariel Flesler's avatar Ariel Flesler

test runner: improved a test and added a missing semicolon

parent 16f6b368
...@@ -374,13 +374,15 @@ test("attr(Hash)", function() { ...@@ -374,13 +374,15 @@ test("attr(Hash)", function() {
test("attr(String, Object)", function() { test("attr(String, Object)", function() {
expect(17); expect(17);
var div = $("div"); var div = $("div").attr("foo", "bar");
div.attr("foo", "bar"); fail = false;
var pass = true;
for ( var i = 0; i < div.size(); i++ ) { for ( var i = 0; i < div.size(); i++ ) {
if ( div.get(i).getAttribute('foo') != "bar" ) pass = false; if ( div.get(i).getAttribute('foo') != "bar" ){
fail = i;
break;
}
} }
ok( pass, "Set Attribute" ); equals( fail, false, "Set Attribute, the #"+fail+" element didn't get the attribute 'foo'" );
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" ); ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
...@@ -412,7 +414,7 @@ test("attr(String, Object)", function() { ...@@ -412,7 +414,7 @@ test("attr(String, Object)", function() {
j.attr("name", "attrvalue"); j.attr("name", "attrvalue");
equals( j.attr("name"), "attrvalue", "Check node,textnode,comment for attr" ); equals( j.attr("name"), "attrvalue", "Check node,textnode,comment for attr" );
j.removeAttr("name") j.removeAttr("name");
reset(); reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment