import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks' ; import { ImportListItemsToStreamOptions , WriteBufferToItemsOptions } from '../items' ; import { LIST_ID , LIST_INDEX , LIST_ITEM_INDEX , META , TYPE , USER , VERSION , } from '../../../common/constants.mock' ; import { getConfigMockDecoded } from '../../config.mock' ; import { TestReadable } from './test_readable.mock' ; export const getImportListItemsToStreamOptionsMock = ( ) : ImportListItemsToStreamOptions => ( { config : getConfigMockDecoded ( ) , deserializer : undefined , esClient : elasticsearchClientMock . createScopedClusterClient ( ) . asCurrentUser , listId : LIST_ID , listIndex : LIST_INDEX , listItemIndex : LIST_ITEM_INDEX , meta : META , serializer : undefined , stream : new TestReadable ( ) , type : TYPE , user : USER , version : VERSION , } ) ; export const getWriteBufferToItemsOptionsMock = ( ) : WriteBufferToItemsOptions => ( { buffer : [ ] , deserializer : undefined , esClient : elasticsearchClientMock . createScopedClusterClient ( ) . asCurrentUser , listId : LIST_ID , listItemIndex : LIST_ITEM_INDEX , meta : META , serializer : undefined , type : TYPE , user : USER , } ) ;