diff options
author | Aditya Raghavan <araghavan3@gmail.com> | 2014-12-20 04:08:44 -0500 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2014-12-24 00:33:00 +0300 |
commit | 1b932bb7867924b98529537f8ccd35db979ae22a (patch) | |
tree | ab8da348bfbd63515f8abcf74557d81a1c0dbe37 /test | |
parent | d21edb599d8f5f80a3f3ecba5b62311b9cd1a3e6 (diff) | |
download | jquery-1b932bb7867924b98529537f8ccd35db979ae22a.tar.gz jquery-1b932bb7867924b98529537f8ccd35db979ae22a.zip |
CSS: Add unit tests for negative margins and positioning
Closes gh-1957
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/css.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index b424d56eb..c03579103 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -248,6 +248,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 ); |