From: Aditya Raghavan Date: Sat, 20 Dec 2014 09:08:44 +0000 (-0500) Subject: CSS: Add unit tests for negative margins and positioning X-Git-Tag: 3.0.0-alpha1+compat~167 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ae30fb6c27a2121578d3ce7ca6e2ba1d205545b8;p=jquery.git CSS: Add unit tests for negative margins and positioning Ref 1b932bb7867924b98529537f8ccd35db979ae22a --- diff --git a/test/unit/css.js b/test/unit/css.js index 94aad7777..a5bd304b2 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -251,6 +251,21 @@ test("css(String, Object)", function() { "Set font shorthand property (#14759)" ); }); +test( "css(String, Object) with negative values", function() { + expect( 4 ); + + jQuery( "#nothiddendiv" ).css( "margin-top", "-10px" ); + jQuery( "#nothiddendiv" ).css( "margin-left", "-10px" ); + equal( jQuery( "#nothiddendiv" ).css( "margin-top" ), "-10px", "Ensure negative top margins work." ); + equal( jQuery( "#nothiddendiv" ).css( "margin-left" ), "-10px", "Ensure negative left margins work." ); + + jQuery( "#nothiddendiv" ).css( "position", "absolute" ); + jQuery( "#nothiddendiv" ).css( "top", "-20px" ); + jQuery( "#nothiddendiv" ).css( "left", "-20px" ); + equal( jQuery( "#nothiddendiv" ).css( "top" ), "-20px", "Ensure negative top values work." ); + equal( jQuery( "#nothiddendiv" ).css( "left" ), "-20px", "Ensure negative left values work." ); +}); + test( "css(Array)", function() { expect( 2 );