import { getConfig } from './get_config' ; import { createMockPieParams } from '../mocks' ; const visParams = createMockPieParams ( ) ; describe ( 'getConfig' , ( ) => { it ( 'should cap the outerSizeRatio to 1' , ( ) => { expect ( getConfig ( visParams , { } , { width : 400 , height : 400 } ) . outerSizeRatio ) . toBe ( 1 ) ; } ) ; it ( 'should not have outerSizeRatio for split chart' , ( ) => { expect ( getConfig ( { ... visParams , dimensions : { ... visParams . dimensions , splitColumn : [ { type : 'vis_dimension' , accessor : 1 , format : { id : 'number' , params : { } , } , } , ] , } , } , { } , { width : 400 , height : 400 } ) . outerSizeRatio ) . toBeUndefined ( ) ; expect ( getConfig ( { ... visParams , dimensions : { ... visParams . dimensions , splitRow : [ { type : 'vis_dimension' , accessor : 1 , format : { id : 'number' , params : { } , } , } , ] , } , } , { } , { width : 400 , height : 400 } ) . outerSizeRatio ) . toBeUndefined ( ) ; } ) ; it ( 'should not set outerSizeRatio if dimensions are not defined' , ( ) => { expect ( getConfig ( visParams , { } ) . outerSizeRatio ) . toBeUndefined ( ) ; } ) ; } ) ;