X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Feffects.js;h=4bb92fc00120776f98225bfc5e85f7eac5d76527;hb=85d9343271da85fc945bf37a604873eaf247a3a7;hp=a07c076d7820b14df2b75b094ec333e78c43afa6;hpb=b9f5e2b97458f89cbcac3a333ba95b0eac568d49;p=jquery.git diff --git a/test/unit/effects.js b/test/unit/effects.js index a07c076..4bb92fc 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -558,21 +558,44 @@ jQuery.checkOverflowDisplay = function(){ start(); } -test("support negative values < -10000 (bug #7193)", function () { - expect(1); - stop(); - - jQuery.extend(jQuery.fx.step, { - "marginBottom": function(fx) { - equals( fx.cur(), -11000, "Element has margin-bottom of -11000" ); - delete jQuery.fx.step.marginBottom; - } - }); - - jQuery("#main").css("marginBottom", "-11000px").animate({ marginBottom: "-11001px" }, { - duration: 1, - complete: start - }); +test("jQuery.fx.prototype.cur()", function() { + expect(5); + var nothiddendiv = jQuery('#nothiddendiv').css({ + color: '#ABC', + border: '5px solid black', + left: 'auto', + marginBottom: '11000px' + })[0]; + + equals( + (new jQuery.fx( nothiddendiv, {}, 'color' )).cur(), + jQuery.css( nothiddendiv,'color' ), + "Return the same value as jQuery.css for complex properties (bug #7912)" + ); + + strictEqual( + (new jQuery.fx( nothiddendiv, {}, 'borderLeftWidth' )).cur(), + 5, + "Return simple values parsed as Float" + ); + + strictEqual( + (new jQuery.fx( nothiddendiv, {}, 'backgroundPosition' )).cur(), + 0, + 'Return 0 when jQuery.css returns an empty string' + ); + + strictEqual( + (new jQuery.fx( nothiddendiv, {}, 'left' )).cur(), + 0, + 'Return 0 when jQuery.css returns "auto"' + ); + + equals( + (new jQuery.fx( nothiddendiv, {}, 'marginBottom' )).cur(), + 11000, + "support negative values < -10000 (bug #7193)" + ); }); test("JS Overflow and Display", function() {