import { getRedirectToAfterEngineCreation } from './utils' ; describe ( 'getRedirectToAfterEngineCreation' , ( ) => { it ( 'returns crawler path when ingestionMethod is crawler' , ( ) => { const engineName = 'elastic' ; const redirectTo = getRedirectToAfterEngineCreation ( { ingestionMethod : 'crawler' , engineName } ) ; expect ( redirectTo ) . toEqual ( '/engines/elastic/crawler' ) ; } ) ; it ( 'returns engine overview path when there is no ingestionMethod' , ( ) => { const engineName = 'elastic' ; const redirectTo = getRedirectToAfterEngineCreation ( { ingestionMethod : '' , engineName } ) ; expect ( redirectTo ) . toEqual ( '/engines/elastic' ) ; } ) ; it ( 'returns engine overview path with query param when there is ingestionMethod' , ( ) => { const engineName = 'elastic' ; const redirectTo = getRedirectToAfterEngineCreation ( { ingestionMethod : 'api' , engineName } ) ; expect ( redirectTo ) . toEqual ( '/engines/elastic?method=api' ) ; } ) ; } ) ;