import { listCustomLinks } from './list_custom_links' ; import { inspectSearchParams , SearchParamsMock , } from '../../../utils/test_helpers' ; import { Setup } from '../../../lib/helpers/setup_request' ; import { SERVICE_NAME , TRANSACTION_NAME , } from '../../../../common/elasticsearch_fieldnames' ; describe ( 'List Custom Links' , ( ) => { let mock ; it ( 'fetches all custom links' , async ( ) => { mock = await inspectSearchParams ( ( setup ) => listCustomLinks ( { setup : setup as unknown as Setup , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; it ( 'filters custom links' , async ( ) => { const filters = { [ SERVICE_NAME ] : 'foo' , [ TRANSACTION_NAME ] : 'bar' , } ; mock = await inspectSearchParams ( ( setup ) => listCustomLinks ( { filters , setup : setup as unknown as Setup , } ) ) ; expect ( mock . params ) . toMatchSnapshot ( ) ; } ) ; } ) ;