import expect from '@kbn/expect' ; import { Spaces } from '../../scenarios' ; import { getUrlPrefix } from '../../../common/lib/space_test_utils' ; import { FtrProviderContext } from '../../../common/ftr_provider_context' ; export default function listActionTypesTests ( { getService } ) { const supertest = getService ( 'supertest' ) ; describe ( 'connector_types' , ( ) => { it ( 'should return 200 with list of connector types containing defaults' , async ( ) => { const response = await supertest . get ( `${ getUrlPrefix ( Spaces . space1 . id ) }/api/actions/connector_types` ) ; function createActionTypeMatcher ( id , name ) { return ( actionType ) => { return actionType . id === id && actionType . name === name ; } ; } expect ( response . status ) . to . eql ( 200 ) ; expect ( response . body . some ( createActionTypeMatcher ( 'test.index-record' , 'Test: Index Record' ) ) ) . to . be ( true ) ; } ) ; describe ( 'legacy' , ( ) => { it ( 'should return 200 with list of action types containing defaults' , async ( ) => { const response = await supertest . get ( `${ getUrlPrefix ( Spaces . space1 . id ) }/api/actions/list_action_types` ) ; function createActionTypeMatcher ( id , name ) { return ( actionType ) => { return actionType . id === id && actionType . name === name ; } ; } expect ( response . status ) . to . eql ( 200 ) ; expect ( response . body . some ( createActionTypeMatcher ( 'test.index-record' , 'Test: Index Record' ) ) ) . to . be ( true ) ; } ) ; } ) ; } ) ; }