add line-height to unitless css props, test cases

This commit is contained in:
Cheng Lou
2013-09-30 13:56:56 -04:00
parent 8835e9d99f
commit 27ee9c6eb0
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -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',