diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js index c3bf71a63..6a8453902 100644 --- a/test/unit/dimensions.js +++ b/test/unit/dimensions.js @@ -468,7 +468,8 @@ testIframe( "dimensions/documentLarge", "window vs. large document", function( j }); test( "allow modification of coordinates argument (gh-1848)", 1, function() { - var element = jQuery( "
" ).appendTo( "#qunit-fixture" ); + var offsetTop, + element = jQuery( "
" ).appendTo( "#qunit-fixture" ); element.offset(function( index, coords ) { coords.top = 100; @@ -476,7 +477,9 @@ test( "allow modification of coordinates argument (gh-1848)", 1, function() { return coords; }); - equal( element.offset().top, 100, "coordinates are modified" ); + offsetTop = element.offset().top; + ok( Math.abs(offsetTop - 100) < 0.02, + "coordinates are modified (got offset.top: " + offsetTop + ")"); }); })();