diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-07-23 15:53:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-23 15:53:36 +0200 |
commit | 91037d66b0ea8dd7db0b6083721d0d1b2106cd16 (patch) | |
tree | cb4fedd3436a94ac7f45162dc0816b74739c3bdb /tests | |
parent | b8ec78a37af50b95bab71416b8593e84b239fca7 (diff) | |
download | jquery-ui-91037d66b0ea8dd7db0b6083721d0d1b2106cd16.tar.gz jquery-ui-91037d66b0ea8dd7db0b6083721d0d1b2106cd16.zip |
Tests: Accept a small difference of animated width/height
jQuery 3.2 & newer have a different animation logic and the animated elements
width/height differ from the starting ones even at the beginning of the
animation. The point of the assertions checking that they're identical was
to ensure bug #5245 is fixed; that issue manifested by a big jump to half the
element size. To test for that, it's enough to check that the first obtained
values are close to the original ones.
This makes effects tests pass in all supported jQuery versions.
Closes gh-1928
Ref #5245
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/effects/core.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit/effects/core.js b/tests/unit/effects/core.js index b8da50d5d..b2d039a54 100644 --- a/tests/unit/effects/core.js +++ b/tests/unit/effects/core.js @@ -378,8 +378,10 @@ $.each( $.effects.effect, function( effect ) { assert.equal( test[ 0 ].style.height, cssHeight, "Inline CSS Height has been rest after animation ended" ); ready(); } ); - assert.equal( test.width(), width, "Width is the same px after animation started" ); - assert.equal( test.height(), height, "Height is the same px after animation started" ); + assert.ok( Math.abs( test.width() - width ) / width < 0.05, + "Width is close to the value when animation started" ); + assert.ok( Math.abs( test.height() - height ) / height < 0.05, + "Height is close to the value when animation started" ); } ); } ); |