Skip to content

Commit 792408c

Browse files
gibson042dmethvin
authored andcommitted
Attributes: Only assert button.attr('value', val) for jQuery>=1.9
Fixes jquery#68 Closes jquery#69
1 parent 11f2d52 commit 792408c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/attributes.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ test( "attrHooks[\"value\"]", function() {
7474
var button = jQuery("#button"),
7575
majorMinorPatch = jQuery.fn.jquery.split(".");
7676

77-
// Respect the jQuery 1.9.0+ behavior change
77+
// Respect the jQuery 1.9.0+ behavior changes
7878
if ( majorMinorPatch[0] > 1 || ( majorMinorPatch[0] === "1" && majorMinorPatch[1] >= 9 ) ) {
7979
equal( button.attr("value"), undefined, "button.attr('value') returns attribute." );
80+
equal( button.attr( "value", "foo" ).attr("value"), "foo", "button.attr('value', val) sets attribute." );
8081
} else {
8182
equal( button.attr("value"), "", "button.attr('value') returns empty string." );
83+
ok( true, "Can't assert consistency of button.attr('value', val) on jQuery<1.9.0." );
8284
}
83-
equal( button.attr( "value", "foo" ).attr("value"), "foo", "button.attr('value', val) sets attribute." );
84-
equal( button.html(), "Button", "button.attr('value') doesn't affect contents" );
85+
equal( button.attr( "value", "bar" ).html(), "Button", "button.attr('value') doesn't affect contents" );
8586
});
8687

8788
expectWarning( "div.attr(...)", 2, function() {

0 commit comments

Comments
 (0)