Repository: jquery/jquery
File: test/unit/css.js (JavaScript)

Code before:
				"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 + "'" );
			}
		} 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 ) {
	assert.expect( 4 );

	var el_dis = jQuery( "<div style='width:300px;height:300px;margin:2px;padding:2px;box-sizing:border-box;'>test</div>" ),
		el = el_dis.clone().appendTo( "#qunit-fixture" );

	assert.equal( el.css( "width" ), el.css( "width", el.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing, see #11004" );
	assert.equal( el_dis.css( "width" ), el_dis.css( "width", el_dis.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing for disconnected element, see #11004" );
	assert.equal( el.css( "height" ), el.css( "height", el.css( "height" ) ).css( "height" ), "css('height') is not respecting box-sizing, see #11004" );
	assert.equal( el_dis.css( "height" ), el_dis.css( "height", el_dis.css( "height" ) ).css( "height" ), "css('height') is not respecting box-sizing for disconnected element, see #11004" );
} );

testIframe(
	"css('width') should work correctly before document ready (#14084)",
	"css/cssWidthBeforeDocReady.html",
	function( assert, jQuery, window, document, cssWidthBeforeDocReady ) {

Review comment (suggestion):
Suggestion for differentiating assertions: `"Do not append px to '" + prop + "' (retrieved " + subProp + ")"`.

Code after:
				"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 ) {
	assert.expect( 4 );

	var el_dis = jQuery( "<div style='width:300px;height:300px;margin:2px;padding:2px;box-sizing:border-box;'>test</div>" ),
		el = el_dis.clone().appendTo( "#qunit-fixture" );

	assert.equal( el.css( "width" ), el.css( "width", el.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing, see #11004" );
	assert.equal( el_dis.css( "width" ), el_dis.css( "width", el_dis.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing for disconnected element, see #11004" );
	assert.equal( el.css( "height" ), el.css( "height", el.css( "height" ) ).css( "height" ), "css('height') is not respecting box-sizing, see #11004" );
	assert.equal( el_dis.css( "height" ), el_dis.css( "height", el_dis.css( "height" ) ).css( "height" ), "css('height') is not respecting box-sizing for disconnected element, see #11004" );
} );

testIframe(
	"css('width') should work correctly before document ready (#14084)",
	"css/cssWidthBeforeDocReady.html",