import { MockRouter , mockRequestHandler , mockDependencies } from '../../__mocks__' ; import { registerSearchRoutes } from './search' ; describe ( 'search routes' , ( ) => { describe ( 'GET /internal/app_search/engines/{engineName}/search' , ( ) => { let mockRouter ; beforeEach ( ( ) => { jest . clearAllMocks ( ) ; mockRouter = new MockRouter ( { method : 'get' , path : '/internal/app_search/engines/{engineName}/schema' , } ) ; registerSearchRoutes ( { ... mockDependencies , router : mockRouter . router , } ) ; } ) ; it ( 'creates a request handler' , ( ) => { expect ( mockRequestHandler . createRequest ) . toHaveBeenCalledWith ( { path : '/as/engines/:engineName/dashboard_search' , } ) ; } ) ; } ) ; } ) ;