mirror of
https://github.com/jquery/jquery.git
synced 2024-12-09 08:04:24 +00:00
Tests: Correct logic of a broken assertion
This commit is contained in:
parent
9d79b99874
commit
ebbbe965b8
@ -374,8 +374,6 @@ test( "attr(String, Object)", function() {
|
|||||||
strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." );
|
strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." );
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register the property name to avoid generating a new global when testing window
|
|
||||||
Globals.register("nonexisting");
|
|
||||||
jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) {
|
jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) {
|
||||||
var oldVal = elem.nonexisting,
|
var oldVal = elem.nonexisting,
|
||||||
$elem = jQuery( elem );
|
$elem = jQuery( elem );
|
||||||
@ -384,6 +382,9 @@ test( "attr(String, Object)", function() {
|
|||||||
elem.nonexisting = oldVal;
|
elem.nonexisting = oldVal;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register the property on the window for the previous assertion so it will be clean up
|
||||||
|
Globals.register( "nonexisting" );
|
||||||
|
|
||||||
table = jQuery("#table").append("<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>");
|
table = jQuery("#table").append("<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>");
|
||||||
td = table.find("td").eq(0);
|
td = table.find("td").eq(0);
|
||||||
td.attr( "rowspan", "2" );
|
td.attr( "rowspan", "2" );
|
||||||
|
Loading…
Reference in New Issue
Block a user