kibana/x-pack/plugins/alerts/server/alerts_client.mock.ts
ymao1 ae007c2e8a
[Alerting] Return alert execution status rollup from _find API (#81819)
* wip

* wip

* Adding aggregation option to find function and using those results in UI

* Requesting aggregations from client instead of hard-coding in route

* alert_api test

* i18n fix

* Adding functional test

* Adding unit test for filters

* Splitting into two API endpoints

* Fixing test

* Fixing test

* Adding comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-03 07:26:44 -05:00

39 lines
1.1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import { AlertsClient } from './alerts_client';
type Schema = PublicMethodsOf<AlertsClient>;
export type AlertsClientMock = jest.Mocked<Schema>;
const createAlertsClientMock = () => {
const mocked: AlertsClientMock = {
aggregate: jest.fn(),
create: jest.fn(),
get: jest.fn(),
getAlertState: jest.fn(),
find: jest.fn(),
delete: jest.fn(),
update: jest.fn(),
enable: jest.fn(),
disable: jest.fn(),
updateApiKey: jest.fn(),
muteAll: jest.fn(),
unmuteAll: jest.fn(),
muteInstance: jest.fn(),
unmuteInstance: jest.fn(),
listAlertTypes: jest.fn(),
getAlertInstanceSummary: jest.fn(),
};
return mocked;
};
export const alertsClientMock: {
create: () => AlertsClientMock;
} = {
create: createAlertsClientMock,
};