Skip to content

Commit

Permalink
Added some tests for name(), id() and title()
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Sep 17, 2006
1 parent c12bce2 commit 51a07a6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/jquery/jquery.js
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 51a07a6

Please sign in to comment.