import { SearchParamsMock , inspectSearchParams , } from '../../utils/test_helpers' ; import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values' ; import { getErrorGroupMainStatistics } from './get_error_groups/get_error_group_main_statistics' ; import { getErrorGroupSample } from './get_error_groups/get_error_group_sample' ; describe ( 'error queries' , ( ) => { let mock ; afterEach ( ( ) => { mock . teardown ( ) ; } ) ; it ( 'fetches a single error group' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getErrorGroupSample ( { groupId : 'groupId' , serviceName : 'serviceName' , setup , environment : ENVIRONMENT_ALL . value , kuery : '' , start : 0 , end : 50000 , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; it ( 'fetches multiple error groups' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getErrorGroupMainStatistics ( { sortDirection : 'asc' , sortField : 'foo' , serviceName : 'serviceName' , transactionType : 'request' , setup , environment : ENVIRONMENT_ALL . value , kuery : '' , start : 0 , end : 50000 , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; it ( 'fetches multiple error groups when sortField = lastSeen' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getErrorGroupMainStatistics ( { sortDirection : 'asc' , sortField : 'lastSeen' , serviceName : 'serviceName' , transactionType : 'request' , setup , environment : ENVIRONMENT_ALL . value , kuery : '' , start : 0 , end : 50000 , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; } ) ;