From 51a07a6a5f8b1e58fbbce6bcfe4d909a3f9ca964 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Sun, 17 Sep 2006 11:58:44 +0000 Subject: [PATCH] Added some tests for name(), id() and title() --- src/jquery/jquery.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 0b6b1f4..b0db099 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -2673,6 +2673,10 @@ jQuery.macros = { * @before * @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 * @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 * @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 -- 1.7.10.4