kibana/x-pack/plugins/alerts/public/mocks.ts
Yuliia Naumenko ce45dad8b6
Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE (#66838)
* Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE

* Changed alerting REST API to keep the pattern 'alerts/alert/{id}'

* fixed tests

* fixed tests

* Fixed jest tests

* Renamed plugin from alerting to alerts

* fixed tests

* fixed tests

* Fixed alert type check error

* Fixed find api

* fixed type checks

* fixed tests security issues

* Fixed view in app

* -

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-01 18:45:36 -07:00

25 lines
730 B
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 { AlertingPublicPlugin } from './plugin';
export type Setup = jest.Mocked<ReturnType<AlertingPublicPlugin['setup']>>;
export type Start = jest.Mocked<ReturnType<AlertingPublicPlugin['start']>>;
const createSetupContract = (): Setup => ({
registerNavigation: jest.fn(),
registerDefaultNavigation: jest.fn(),
});
const createStartContract = (): Start => ({
getNavigation: jest.fn(),
});
export const alertingPluginMock = {
createSetupContract,
createStartContract,
};