]> source.dussan.org Git - jquery.git/commitdiff
Added some tests for name(), id() and title()
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 17 Sep 2006 11:58:44 +0000 (11:58 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 17 Sep 2006 11:58:44 +0000 (11:58 +0000)
src/jquery/jquery.js

index 0b6b1f4fb9c773eae1d9ef6da543701f47466773..b0db0991a4bb1c7682c9a55ddbff65a97869fd95 100644 (file)
@@ -2673,6 +2673,10 @@ jQuery.macros = {
                 * @before <input type="text" id="test" value="some text"/>
                 * @result "test"
                 *
+                * @test ok( $(document.getElementById('main')).id() == "main", "Check for id" );
+                * @test ok( $("#foo").id() == "foo", "Check for id" );
+                * @test ok( !$("head").id(), "Check for id" );
+                *
                 * @name id
                 * @type String
                 * @cat DOM/Attributes
@@ -2699,6 +2703,9 @@ jQuery.macros = {
                 * @before <img src="test.jpg" title="my image"/>
                 * @result "my image"
                 *
+                * @test ok( $(document.getElementById('google')).title() == "Google!", "Check for title" );
+                * @test ok( !$("#yahoo").title(), "Check for title" );
+                *
                 * @name title
                 * @type String
                 * @cat DOM/Attributes
@@ -2725,6 +2732,10 @@ jQuery.macros = {
                 * @before <input type="text" name="username"/>
                 * @result "username"
                 *
+                * @test ok( $(document.getElementById('text1')).name() == "action", "Check for name" );
+                * @test ok( $("#hidden1").name() == "hidden", "Check for name" );
+                * @test ok( !$("#area1").name(), "Check for name" );
+                *
                 * @name name
                 * @type String
                 * @cat DOM/Attributes