aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/effects.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2013-01-15 23:09:35 -0500
committerDave Methvin <dave.methvin@gmail.com>2013-01-15 23:28:56 -0500
commit65df32dc21dc315fe0dcccdcf7d07884f4794ccd (patch)
tree3fe68918477ca59a8c762595d7825b4fafd5aad8 /test/unit/effects.js
parent79feac9584396f3628c07d0eed7557d5f70043ec (diff)
downloadjquery-65df32dc21dc315fe0dcccdcf7d07884f4794ccd.tar.gz
jquery-65df32dc21dc315fe0dcccdcf7d07884f4794ccd.zip
Fix #13183: Wrong animation initial value calc. Close gh-1136.
Diffstat (limited to 'test/unit/effects.js')
-rw-r--r--test/unit/effects.js31
1 files changed, 24 insertions, 7 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js
index 1edecc07a..aa061058b 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -283,14 +283,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();
+ }
});
});