diff --git a/x-pack/plugins/index_management/public/mocks.ts b/x-pack/plugins/index_management/public/mocks.ts index 30e21c80be5b1..69a43b985787a 100644 --- a/x-pack/plugins/index_management/public/mocks.ts +++ b/x-pack/plugins/index_management/public/mocks.ts @@ -6,12 +6,15 @@ */ import { extensionsServiceMock } from './services/extensions_service.mock'; +import { publicApiServiceMock } from './services/public_api_service.mock'; export { extensionsServiceMock } from './services/extensions_service.mock'; +export { publicApiServiceMock } from './services/public_api_service.mock'; function createIdxManagementSetupMock() { const mock = { extensionsService: extensionsServiceMock, + publicApiService: publicApiServiceMock, }; return mock; diff --git a/x-pack/plugins/index_management/public/services/public_api_service.mock.ts b/x-pack/plugins/index_management/public/services/public_api_service.mock.ts new file mode 100644 index 0000000000000..85ce1b232c06a --- /dev/null +++ b/x-pack/plugins/index_management/public/services/public_api_service.mock.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PublicApiServiceSetup } from './public_api_service'; + +export type PublicApiServiceSetupMock = jest.Mocked; + +const createServiceMock = (): PublicApiServiceSetupMock => ({ + getAllEnrichPolicies: jest.fn(), +}); + +export const publicApiServiceMock = { + createSetupContract: createServiceMock, +};