Skip to content

Commit

Permalink
Add public api service mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sabarasaba committed Aug 10, 2023
1 parent 0695f55 commit 379011c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x-pack/plugins/index_management/public/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<PublicApiServiceSetup>;

const createServiceMock = (): PublicApiServiceSetupMock => ({
getAllEnrichPolicies: jest.fn(),
});

export const publicApiServiceMock = {
createSetupContract: createServiceMock,
};

0 comments on commit 379011c

Please sign in to comment.