diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2013-01-15 23:09:35 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-01-15 23:34:22 -0500 |
commit | 10cc33e27beb56e41bea1274bc3b51b1c59af9af (patch) | |
tree | c0831dedb86da9f755073bfde5fb140e81bcd7bc /test | |
parent | 86278d40ae86ecd45786eebcb20b72564f2bb53f (diff) | |
download | jquery-10cc33e27beb56e41bea1274bc3b51b1c59af9af.tar.gz jquery-10cc33e27beb56e41bea1274bc3b51b1c59af9af.zip |
Fix #13183: Wrong animation initial value calc. Ref gh-1136.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/effects.js | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js index 16b4c15e5..3f986097e 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -257,14 +257,31 @@ test("animate native inline width/height", function() { }); }); -test("animate block width/height", function() { - expect(3); +test( "animate block width/height", function() { + expect( 3 ); stop(); - jQuery("#foo").css({ display: "block", width: 20, height: 20 }).animate({ width: 42, height: 42 }, 100, function() { - equal( jQuery(this).css("display"), "block", "inline-block was not set on block element when animating width/height" ); - equal( this.offsetWidth, 42, "width was animated" ); - equal( this.offsetHeight, 42, "height was animated" ); - start(); + + jQuery("<div>").appendTo("#qunit-fixture").css({ + display: "block", + width: 20, + height: 20, + paddingLeft: 60 + }).animate({ + width: 42, + height: 42 + }, { + duration: 100, + step: function() { + if ( jQuery( this ).width() > 42 ) { + ok( false, "width was incorrectly augmented during animation" ); + } + }, + complete: function() { + equal( jQuery( this ).css("display"), "block", "inline-block was not set on block element when animating width/height" ); + equal( jQuery( this ).width(), 42, "width was animated" ); + equal( jQuery( this ).height(), 42, "height was animated" ); + start(); + } }); }); |