diff options
Diffstat (limited to 'test/unit/css.js')
-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 626981b7d..96a231726 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1659,6 +1659,21 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function( assert.equal( $elem.css( "--prop5" ), "'val5'", "Works with single quotes" ); } } ); + + QUnit[ supportsCssVars ? "test" : "skip" ]( "Don't append px to CSS vars", function( assert ) { + assert.expect( 3 ); + + var $div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ); + + $div + .css( "--a", 3 ) + .css( "--line-height", 4 ) + .css( "--lineHeight", 5 ); + + assert.equal( $div.css( "--a" ), "3", "--a: 3" ); + assert.equal( $div.css( "--line-height" ), "4", "--line-height: 4" ); + assert.equal( $div.css( "--lineHeight" ), "5", "--lineHeight: 5" ); + } ); } )(); } |