diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-18 11:05:20 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-18 11:05:20 -0400 |
commit | 7d3ba9f89e8077dff96e4cd9784fda20625c38d6 (patch) | |
tree | 0c6fe7185bf801849a251c0f61c38f316f7e4c56 /test | |
parent | c17f589ec99e8309e813a4081eed47f39a0c6120 (diff) | |
download | jquery-7d3ba9f89e8077dff96e4cd9784fda20625c38d6.tar.gz jquery-7d3ba9f89e8077dff96e4cd9784fda20625c38d6.zip |
Switched title attribute to getAttributeNode for IE6/7. Fixes #9329.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/attributes.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 9ecf2360b..549efcab0 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -40,7 +40,7 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() { }); test("attr(String)", function() { - expect(40); + expect(42); equals( jQuery("#text1").attr("type"), "text", "Check for type attribute" ); equals( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" ); @@ -115,14 +115,16 @@ test("attr(String)", function() { equals( jQuery("#table").attr("test:attrib"), undefined, "Retrieving a non-existent attribute on a table with a colon does not throw an error." ); equals( jQuery("#table").attr("test:attrib", "foobar").attr("test:attrib"), "foobar", "Setting an attribute on a table with a colon does not throw an error." ); - ok( jQuery("<div/>").attr("doesntexist") === undefined, "Make sure undefined is returned when no attribute is found." ); - ok( jQuery().attr("doesntexist") === undefined, "Make sure undefined is returned when no element is there." ); - var $form = jQuery("<form class='something'></form>").appendTo("#qunit-fixture"); equal( $form.attr("class"), "something", "Retrieve the class attribute on a form." ); var $a = jQuery("<a href='#' onclick='something()'>Click</a>").appendTo("#qunit-fixture"); equal( $a.attr("onclick"), "something()", "Retrieve ^on attribute without anonymous function wrapper." ); + + ok( jQuery("<div/>").attr("doesntexist") === undefined, "Make sure undefined is returned when no attribute is found." ); + ok( jQuery("<div/>").attr("title") === undefined, "Make sure undefined is returned when no attribute is found." ); + equal( jQuery("<div/>").attr("title", "something").attr("title"), "something", "Set the title attribute." ); + ok( jQuery().attr("doesntexist") === undefined, "Make sure undefined is returned when no element is there." ); }); if ( !isLocal ) { |