From f5e36bd8f2c2b28231bbed926c6c3dead94db545 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Mon, 30 Apr 2018 18:52:39 +0200 Subject: CSS: Skip the px-appending logic for animations of non-element props Without this change animating properties from jQuery.cssNumber on non-elements throws an error. Ref gh-4055 Closes gh-4061 --- test/unit/effects.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/unit/effects.js b/test/unit/effects.js index 462524ef3..e297273e4 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -607,6 +607,17 @@ QUnit.test( "animate non-element", function( assert ) { this.clock.tick( 200 ); } ); +QUnit.test( "animate non-element's zIndex without appending \"px\"", function( assert ) { + assert.expect( 1 ); + + var obj = { zIndex: 0 }; + + jQuery( obj ).animate( { zIndex: 200 }, 200, function() { + assert.equal( obj.zIndex, 200, "The custom property should be modified without appending \"px\"." ); + } ); + this.clock.tick( 200 ); +} ); + QUnit.test( "stop()", function( assert ) { assert.expect( 4 ); -- cgit v1.2.3