Skip to content

Commit

Permalink
CSS: Add unit tests for negative margins and positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
araghava authored and markelog committed Dec 23, 2014
1 parent d21edb5 commit 1b932bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/css.js
Expand Up @@ -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 );

Expand Down

0 comments on commit 1b932bb

Please sign in to comment.