import { calculateDomainForSeries } from './series_domain_calculation' ; import { PanelData } from 'src/plugins/vis_types/timeseries/common/types' ; describe ( 'calculateDomainForSeries' , ( ) => { it ( 'should return 0 for domainStart and 3 for domainEnd' , ( ) => { const series = [ { data : [ [ 0 , 0 ] , [ 1 , 1 ] , [ 2 , 2 ] , [ 3 , 3 ] , ] , } , ] as PanelData [ ] ; const domainBounds = calculateDomainForSeries ( series ) ; expect ( domainBounds ?. domainStart ) . toBe ( 0 ) ; expect ( domainBounds ?. domainEnd ) . toBe ( 3 ) ; } ) ; it ( 'should return undefined when series is empty' , ( ) => { const domainBounds = calculateDomainForSeries ( [ ] ) ; expect ( domainBounds ) . toBeUndefined ( ) ; } ) ; } ) ;