kibana/x-pack/plugins/triggers_actions_ui/public/application/home.test.tsx
Yuliia Naumenko b11f7830cb
[Alerting UI] Replaced AppContextProvider introduced by the plugin with KibanaContextProvider (#83248)
* Replaced AppContextProvider introduced by the plugin with KibanaContextProvider

* Removed unused files

* Fixed jest test

* Removed ActionsConnectorContext

* exposed addConnectorFlyout and editConnectorFlyouts as a plugin start result

* removed rest of unused connectors context

* fixed capabilities

* fixed jest tests

* fixed jest tests

* fixed jest tests

* fixed uptime

* fixed typecheck errors

* fixed typechecks

* fixed jest tests

* fixed type

* fixed uptime settings by pathing the correct plugin dependancy

* fixed security detection rules

* fixed due to commetns

* fixed jest tests

* fixed type check

* removed orig files

* fixed cases UI issues

* fixed due to comments

* fixed due to comments

* fixed kibana crash

* fixed es-lint
2020-11-24 00:07:47 -08:00

42 lines
1.5 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 * as React from 'react';
import { RouteComponentProps, Router } from 'react-router-dom';
import { createMemoryHistory, createLocation } from 'history';
import { mountWithIntl } from '@kbn/test/jest';
import TriggersActionsUIHome, { MatchParams } from './home';
import { useKibana } from '../common/lib/kibana';
jest.mock('../common/lib/kibana');
const useKibanaMock = useKibana as jest.Mocked<typeof useKibana>;
describe('home', () => {
it('renders the documentation link', async () => {
const props: RouteComponentProps<MatchParams> = {
history: createMemoryHistory(),
location: createLocation('/'),
match: {
isExact: true,
path: `/alerts`,
url: '',
params: {
section: 'alerts',
},
},
};
const wrapper = mountWithIntl(
<Router history={useKibanaMock().services.history}>
<TriggersActionsUIHome {...props} />
</Router>
);
const documentationLink = wrapper.find('[data-test-subj="documentationLink"]');
expect(documentationLink.exists()).toBeTruthy();
expect(documentationLink.first().prop('href')).toEqual(
'https://www.elastic.co/guide/en/kibana/mocked-test-branch/managing-alerts-and-actions.html'
);
});
});