@@ -76,6 +76,8 @@ describe('gridstack utils', function() {
7676 expect ( Utils . parseHeight ( '12.3vh' ) ) . toEqual ( jasmine . objectContaining ( { h : 12.3 , unit : 'vh' } ) ) ;
7777 expect ( Utils . parseHeight ( '12.3vw' ) ) . toEqual ( jasmine . objectContaining ( { h : 12.3 , unit : 'vw' } ) ) ;
7878 expect ( Utils . parseHeight ( '12.3%' ) ) . toEqual ( jasmine . objectContaining ( { h : 12.3 , unit : '%' } ) ) ;
79+ expect ( Utils . parseHeight ( '12.5cm' ) ) . toEqual ( jasmine . objectContaining ( { h : 12.5 , unit : 'cm' } ) ) ;
80+ expect ( Utils . parseHeight ( '12.5mm' ) ) . toEqual ( jasmine . objectContaining ( { h : 12.5 , unit : 'mm' } ) ) ;
7981 expect ( Utils . parseHeight ( '12.5' ) ) . toEqual ( jasmine . objectContaining ( { h : 12.5 , unit : 'px' } ) ) ;
8082 expect ( function ( ) { Utils . parseHeight ( '12.5 df' ) ; } ) . toThrowError ( 'Invalid height' ) ;
8183 } ) ;
@@ -89,6 +91,8 @@ describe('gridstack utils', function() {
8991 expect ( Utils . parseHeight ( '-12.3vh' ) ) . toEqual ( jasmine . objectContaining ( { h : - 12.3 , unit : 'vh' } ) ) ;
9092 expect ( Utils . parseHeight ( '-12.3vw' ) ) . toEqual ( jasmine . objectContaining ( { h : - 12.3 , unit : 'vw' } ) ) ;
9193 expect ( Utils . parseHeight ( '-12.3%' ) ) . toEqual ( jasmine . objectContaining ( { h : - 12.3 , unit : '%' } ) ) ;
94+ expect ( Utils . parseHeight ( '-12.3cm' ) ) . toEqual ( jasmine . objectContaining ( { h : - 12.3 , unit : 'cm' } ) ) ;
95+ expect ( Utils . parseHeight ( '-12.3mm' ) ) . toEqual ( jasmine . objectContaining ( { h : - 12.3 , unit : 'mm' } ) ) ;
9296 expect ( Utils . parseHeight ( '-12.5' ) ) . toEqual ( jasmine . objectContaining ( { h : - 12.5 , unit : 'px' } ) ) ;
9397 expect ( function ( ) { Utils . parseHeight ( '-12.5 df' ) ; } ) . toThrowError ( 'Invalid height' ) ;
9498 } ) ;
0 commit comments