import { mockDependencies , mockRequestHandler , MockRouter } from '../../__mocks__' ; import { registerSearchUIRoutes } from './search_ui' ; describe ( 'reference application routes' , ( ) => { beforeEach ( ( ) => { jest . clearAllMocks ( ) ; } ) ; describe ( 'GET /internal/app_search/engines/{engineName}/search_settings/details' , ( ) => { const mockRouter = new MockRouter ( { method : 'get' , path : '/internal/app_search/engines/{engineName}/search_ui/field_config' , } ) ; beforeEach ( ( ) => { registerSearchUIRoutes ( { ... mockDependencies , router : mockRouter . router , } ) ; } ) ; it ( 'creates a request to enterprise search' , ( ) => { mockRouter . callRoute ( { params : { engineName : 'some-engine' } , } ) ; expect ( mockRequestHandler . createRequest ) . toHaveBeenCalledWith ( { path : '/as/engines/:engineName/search_experience/field_config' , } ) ; } ) ; } ) ; } ) ;