mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
add line-height to unitless css props, test cases
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
var isUnitlessNumber = {
|
||||
fillOpacity: true,
|
||||
fontWeight: true,
|
||||
lineHeight: true,
|
||||
opacity: true,
|
||||
orphans: true,
|
||||
zIndex: true,
|
||||
|
||||
@@ -68,6 +68,21 @@ describe('CSSPropertyOperations', function() {
|
||||
})).toBe('left:0;margin:16px;opacity:0.5;padding:4px;');
|
||||
});
|
||||
|
||||
it('should not append `px` to styles that might need a number', function() {
|
||||
expect(CSSPropertyOperations.createMarkupForStyles({
|
||||
fillOpacity: 1,
|
||||
fontWeight: 2,
|
||||
opacity: 3,
|
||||
orphans: 4,
|
||||
zIndex: 5,
|
||||
zoom: 6,
|
||||
lineHeight: 7
|
||||
})).toBe(
|
||||
'fill-opacity:1;font-weight:2;opacity:3;orphans:4;z-index:5;zoom:6;' +
|
||||
'line-height:7;'
|
||||
);
|
||||
});
|
||||
|
||||
it('should set style attribute when styles exist', function() {
|
||||
var styles = {
|
||||
backgroundColor: '#000',
|
||||
|
||||
Reference in New Issue
Block a user