Commit 51a07a6a authored by Jörn Zaefferer's avatar Jörn Zaefferer

Added some tests for name(), id() and title()

parent c12bce20
...@@ -2673,6 +2673,10 @@ jQuery.macros = { ...@@ -2673,6 +2673,10 @@ jQuery.macros = {
* @before <input type="text" id="test" value="some text"/> * @before <input type="text" id="test" value="some text"/>
* @result "test" * @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 * @name id
* @type String * @type String
* @cat DOM/Attributes * @cat DOM/Attributes
...@@ -2699,6 +2703,9 @@ jQuery.macros = { ...@@ -2699,6 +2703,9 @@ jQuery.macros = {
* @before <img src="test.jpg" title="my image"/> * @before <img src="test.jpg" title="my image"/>
* @result "my image" * @result "my image"
* *
* @test ok( $(document.getElementById('google')).title() == "Google!", "Check for title" );
* @test ok( !$("#yahoo").title(), "Check for title" );
*
* @name title * @name title
* @type String * @type String
* @cat DOM/Attributes * @cat DOM/Attributes
...@@ -2725,6 +2732,10 @@ jQuery.macros = { ...@@ -2725,6 +2732,10 @@ jQuery.macros = {
* @before <input type="text" name="username"/> * @before <input type="text" name="username"/>
* @result "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 * @name name
* @type String * @type String
* @cat DOM/Attributes * @cat DOM/Attributes
......
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