import { VisTypeTimeseriesRequestHandlerContext , VisTypeTimeseriesVisDataRequest , } from '../../../types' ; import { DefaultSearchStrategy } from './default_search_strategy' ; describe ( 'DefaultSearchStrategy' , ( ) => { const requestContext = { core : { uiSettings : { client : { get : jest . fn ( ) , } , } , } , } as unknown as VisTypeTimeseriesRequestHandlerContext ; let defaultSearchStrategy ; let req ; beforeEach ( ( ) => { req = { body : { panels : [ ] , } , } as unknown as VisTypeTimeseriesVisDataRequest ; defaultSearchStrategy = new DefaultSearchStrategy ( ) ; } ) ; test ( 'should init an DefaultSearchStrategy instance' , ( ) => { expect ( defaultSearchStrategy . checkForViability ) . toBeDefined ( ) ; expect ( defaultSearchStrategy . search ) . toBeDefined ( ) ; expect ( defaultSearchStrategy . getFieldsForWildcard ) . toBeDefined ( ) ; } ) ; test ( 'should check a strategy for viability' , async ( ) => { const value = await defaultSearchStrategy . checkForViability ( requestContext , req ) ; expect ( value . isViable ) . toBe ( true ) ; expect ( value . capabilities ) . toMatchInlineSnapshot ( `
      DefaultSearchCapabilities {
        "maxBucketsLimit": undefined,
        "panel": undefined,
        "timezone": undefined,
      }
    ` ) ; } ) ; } ) ;