Tests: Add tests for not auto-appending "px" to CSS Grid properties

Ref gh-4007
Ref gh-4028
Closes gh-4165
This commit is contained in:
Michał Gołębiowski-Owczarek 2018-10-03 12:00:52 +02:00 committed by GitHub
parent dfa92ccead
commit dae5f3ce3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1143,6 +1143,56 @@ QUnit.test( "Do not append px (#9548, #12990, #2792)", function( assert ) {
} }
} ); } );
QUnit[
jQuery( "<div/>" )[ 0 ].style.gridArea === "" ?
"test" :
"skip"
]( "Do not append px to CSS Grid-related properties (gh-4007)", function( assert ) {
assert.expect( 12 );
var prop, value, subProp, subValue, $div,
gridProps = {
"grid-area": {
"grid-row-start": "2",
"grid-row-end": "auto",
"grid-column-start": "auto",
"grid-column-end": "auto"
},
"grid-column": {
"grid-column-start": "2",
"grid-column-end": "auto"
},
"grid-column-end": true,
"grid-column-start": true,
"grid-row": {
"grid-row-start": "2",
"grid-row-end": "auto"
},
"grid-row-end": true,
"grid-row-start": true
};
for ( prop in gridProps ) {
$div = jQuery( "<div/>" ).appendTo( "#qunit-fixture" );
$div.css( prop, 2 );
value = gridProps[ prop ];
if ( typeof value === "object" ) {
for ( subProp in value ) {
subValue = value[ subProp ];
assert.equal( $div.css( subProp ), subValue,
"Do not append px to '" + prop + "' (retrieved " + subProp + ")" );
}
} else {
assert.equal( $div.css( prop ), "2", "Do not append px to '" + prop + "'" );
}
$div.remove();
}
} );
QUnit.test( "css('width') and css('height') should respect box-sizing, see #11004", function( assert ) { QUnit.test( "css('width') and css('height') should respect box-sizing, see #11004", function( assert ) {
assert.expect( 4 ); assert.expect( 4 );