import { inspectSearchParams , SearchParamsMock , } from '../../../utils/test_helpers' ; import { getTransaction } from './get_transaction' ; import { Setup } from '../../../lib/helpers/setup_request' ; import { SERVICE_NAME , TRANSACTION_TYPE , SERVICE_ENVIRONMENT , TRANSACTION_NAME , } from '../../../../common/elasticsearch_fieldnames' ; describe ( 'custom link get transaction' , ( ) => { let mock ; it ( 'fetches without filter' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getTransaction ( { setup : setup as unknown as Setup , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; it ( 'fetches with all filter' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => getTransaction ( { setup : setup as unknown as Setup , filters : { [ SERVICE_NAME ] : 'foo' , [ SERVICE_ENVIRONMENT ] : 'bar' , [ TRANSACTION_NAME ] : 'baz' , [ TRANSACTION_TYPE ] : 'qux' , } , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; } ) ;