mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Backport/8.0/pr 117941 (#118414)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
4229be455d
commit
acdd56704a
31 changed files with 116 additions and 68 deletions
|
@ -7,4 +7,12 @@
|
|||
*/
|
||||
|
||||
export { registerTestBed } from './testbed';
|
||||
export type { TestBed, TestBedConfig, SetupFunc, UnwrapPromise } from './types';
|
||||
export type {
|
||||
TestBed,
|
||||
TestBedConfig,
|
||||
AsyncTestBedConfig,
|
||||
SetupFunc,
|
||||
UnwrapPromise,
|
||||
SyncSetupFunc,
|
||||
AsyncSetupFunc,
|
||||
} from './types';
|
||||
|
|
|
@ -16,7 +16,14 @@ import {
|
|||
mountComponentAsync,
|
||||
getJSXComponentWithProps,
|
||||
} from './mount_component';
|
||||
import { TestBedConfig, TestBed, SetupFunc } from './types';
|
||||
import {
|
||||
TestBedConfig,
|
||||
AsyncTestBedConfig,
|
||||
TestBed,
|
||||
SetupFunc,
|
||||
SyncSetupFunc,
|
||||
AsyncSetupFunc,
|
||||
} from './types';
|
||||
|
||||
const defaultConfig: TestBedConfig = {
|
||||
defaultProps: {},
|
||||
|
@ -48,10 +55,18 @@ const defaultConfig: TestBedConfig = {
|
|||
});
|
||||
```
|
||||
*/
|
||||
export const registerTestBed = <T extends string = string>(
|
||||
export function registerTestBed<T extends string = string>(
|
||||
Component: ComponentType<any>,
|
||||
config: AsyncTestBedConfig
|
||||
): AsyncSetupFunc<T>;
|
||||
export function registerTestBed<T extends string = string>(
|
||||
Component: ComponentType<any>,
|
||||
config?: TestBedConfig
|
||||
): SetupFunc<T> => {
|
||||
): SyncSetupFunc<T>;
|
||||
export function registerTestBed<T extends string = string>(
|
||||
Component: ComponentType<any>,
|
||||
config?: AsyncTestBedConfig | TestBedConfig
|
||||
): SetupFunc<T> {
|
||||
const {
|
||||
defaultProps = defaultConfig.defaultProps,
|
||||
memoryRouter = defaultConfig.memoryRouter!,
|
||||
|
@ -188,7 +203,7 @@ export const registerTestBed = <T extends string = string>(
|
|||
value,
|
||||
isAsync = false
|
||||
) => {
|
||||
const formInput = typeof input === 'string' ? find(input) : (input as ReactWrapper);
|
||||
const formInput = typeof input === 'string' ? find(input) : input;
|
||||
|
||||
if (!formInput.length) {
|
||||
throw new Error(`Input "${input}" was not found.`);
|
||||
|
@ -207,7 +222,7 @@ export const registerTestBed = <T extends string = string>(
|
|||
value,
|
||||
doUpdateComponent = true
|
||||
) => {
|
||||
const formSelect = typeof select === 'string' ? find(select) : (select as ReactWrapper);
|
||||
const formSelect = typeof select === 'string' ? find(select) : select;
|
||||
|
||||
if (!formSelect.length) {
|
||||
throw new Error(`Select "${select}" was not found.`);
|
||||
|
@ -314,7 +329,7 @@ export const registerTestBed = <T extends string = string>(
|
|||
router.history.push(url);
|
||||
};
|
||||
|
||||
return {
|
||||
const testBed: TestBed<T> = {
|
||||
component,
|
||||
exists,
|
||||
find,
|
||||
|
@ -336,8 +351,10 @@ export const registerTestBed = <T extends string = string>(
|
|||
navigateTo,
|
||||
},
|
||||
};
|
||||
|
||||
return testBed;
|
||||
}
|
||||
};
|
||||
|
||||
return setup;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,10 +7,13 @@
|
|||
*/
|
||||
|
||||
import { Store } from 'redux';
|
||||
import { ReactWrapper } from 'enzyme';
|
||||
import { ReactWrapper as GenericReactWrapper } from 'enzyme';
|
||||
import { LocationDescriptor } from 'history';
|
||||
|
||||
export type AsyncSetupFunc<T> = (props?: any) => Promise<TestBed<T>>;
|
||||
export type SyncSetupFunc<T> = (props?: any) => TestBed<T>;
|
||||
export type SetupFunc<T> = (props?: any) => TestBed<T> | Promise<TestBed<T>>;
|
||||
export type ReactWrapper = GenericReactWrapper<any>;
|
||||
|
||||
export interface EuiTableMetaData {
|
||||
/** Array of rows of the table. Each row exposes its reactWrapper and its columns */
|
||||
|
@ -51,7 +54,7 @@ export interface TestBed<T = string> {
|
|||
find('myForm.nameInput');
|
||||
```
|
||||
*/
|
||||
find: (testSubject: T, reactWrapper?: ReactWrapper) => ReactWrapper<any>;
|
||||
find: (testSubject: T, reactWrapper?: ReactWrapper) => ReactWrapper;
|
||||
/**
|
||||
* Update the props of the mounted component
|
||||
*
|
||||
|
@ -147,15 +150,23 @@ export interface TestBed<T = string> {
|
|||
};
|
||||
}
|
||||
|
||||
export interface TestBedConfig {
|
||||
export interface BaseTestBedConfig {
|
||||
/** The default props to pass to the mounted component. */
|
||||
defaultProps?: Record<string, any>;
|
||||
/** Configuration object for the react-router `MemoryRouter. */
|
||||
memoryRouter?: MemoryRouterConfig;
|
||||
/** An optional redux store. You can also provide a function that returns a store. */
|
||||
store?: (() => Store) | Store | null;
|
||||
}
|
||||
|
||||
export interface AsyncTestBedConfig extends BaseTestBedConfig {
|
||||
/* Mount the component asynchronously. When using "hooked" components with _useEffect()_ calls, you need to set this to "true". */
|
||||
doMountAsync?: boolean;
|
||||
doMountAsync: true;
|
||||
}
|
||||
|
||||
export interface TestBedConfig extends BaseTestBedConfig {
|
||||
/* Mount the component asynchronously. When using "hooked" components with _useEffect()_ calls, you need to set this to "true". */
|
||||
doMountAsync?: false;
|
||||
}
|
||||
|
||||
export interface MemoryRouterConfig {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { act } from 'react-dom/test-utils';
|
|||
import { ReactWrapper } from 'enzyme';
|
||||
|
||||
import { EuiDescriptionListDescription } from '@elastic/eui';
|
||||
import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { DataStream } from '../../../common';
|
||||
import { IndexManagementHome } from '../../../public/application/sections/home';
|
||||
import { indexManagementStore } from '../../../public/application/store';
|
||||
|
@ -42,7 +42,7 @@ export interface DataStreamsTabTestBed extends TestBed<TestSubjects> {
|
|||
}
|
||||
|
||||
export const setup = async (overridingDependencies: any = {}): Promise<DataStreamsTabTestBed> => {
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
store: () => indexManagementStore(services as any),
|
||||
memoryRouter: {
|
||||
initialEntries: [`/indices`],
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { IndexManagementHome } from '../../../public/application/sections/home';
|
||||
import { indexManagementStore } from '../../../public/application/store';
|
||||
import { WithAppDependencies, services, TestSubjects } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
store: () => indexManagementStore(services as any),
|
||||
memoryRouter: {
|
||||
initialEntries: [`/indices?includeHidden=true`],
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { TemplateList } from '../../../public/application/sections/home/template_list';
|
||||
import { TemplateDeserialized } from '../../../common';
|
||||
import { WithAppDependencies, TestSubjects } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/templates`],
|
||||
componentRoutePath: `/templates/:templateName?`,
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
import { act } from 'react-dom/test-utils';
|
||||
import { ReactWrapper } from 'enzyme';
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { IndexManagementHome } from '../../../public/application/sections/home';
|
||||
import { indexManagementStore } from '../../../public/application/store';
|
||||
import { WithAppDependencies, services, TestSubjects } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
store: () => indexManagementStore(services as any),
|
||||
memoryRouter: {
|
||||
initialEntries: [`/indices?includeHiddenIndices=true`],
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { TemplateClone } from '../../../public/application/sections/template_clone';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
import { formSetup } from './template_form.helpers';
|
||||
import { TEMPLATE_NAME } from './constants';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/clone_template/${TEMPLATE_NAME}`],
|
||||
componentRoutePath: `/clone_template/:name`,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { TemplateCreate } from '../../../public/application/sections/template_create';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
|
@ -16,7 +16,7 @@ export const setup: any = (isLegacy: boolean = false) => {
|
|||
? { pathname: '/create_template', search: '?legacy=true' }
|
||||
: { pathname: '/create_template' };
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [route],
|
||||
componentRoutePath: route,
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { TemplateEdit } from '../../../public/application/sections/template_edit';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
import { formSetup, TestSubjects } from './template_form.helpers';
|
||||
import { TEMPLATE_NAME } from './constants';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/edit_template/${TEMPLATE_NAME}`],
|
||||
componentRoutePath: `/edit_template/:name`,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { BASE_PATH } from '../../../../../../../common';
|
||||
import { ComponentTemplateCreate } from '../../../component_template_wizard';
|
||||
|
||||
|
@ -19,7 +19,7 @@ export type ComponentTemplateCreateTestBed = TestBed<ComponentTemplateFormTestSu
|
|||
actions: ReturnType<typeof getFormActions>;
|
||||
};
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`${BASE_PATH}/create_component_template`],
|
||||
componentRoutePath: `${BASE_PATH}/create_component_template`,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { BASE_PATH } from '../../../../../../../common';
|
||||
import { ComponentTemplateEdit } from '../../../component_template_wizard';
|
||||
|
||||
|
@ -19,7 +19,7 @@ export type ComponentTemplateEditTestBed = TestBed<ComponentTemplateFormTestSubj
|
|||
actions: ReturnType<typeof getFormActions>;
|
||||
};
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`${BASE_PATH}/edit_component_template/comp-1`],
|
||||
componentRoutePath: `${BASE_PATH}/edit_component_template/:name`,
|
||||
|
|
|
@ -7,12 +7,18 @@
|
|||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig, findTestSubject, nextTick } from '@kbn/test/jest';
|
||||
import {
|
||||
registerTestBed,
|
||||
TestBed,
|
||||
AsyncTestBedConfig,
|
||||
findTestSubject,
|
||||
nextTick,
|
||||
} from '@kbn/test/jest';
|
||||
import { BASE_PATH } from '../../../../../../../common';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
import { ComponentTemplateList } from '../../../component_template_list/component_template_list';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`${BASE_PATH}component_templates`],
|
||||
componentRoutePath: `${BASE_PATH}component_templates`,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig, TestBed } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest';
|
||||
import { PipelinesClone } from '../../../public/application/sections/pipelines_clone';
|
||||
import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
|
@ -28,7 +28,7 @@ export const PIPELINE_TO_CLONE = {
|
|||
],
|
||||
};
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [getClonePath({ clonedPipelineName: PIPELINE_TO_CLONE.name })],
|
||||
componentRoutePath: ROUTES.clone,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig, TestBed } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest';
|
||||
import { PipelinesCreate } from '../../../public/application/sections/pipelines_create';
|
||||
import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
|
@ -15,7 +15,7 @@ export type PipelinesCreateTestBed = TestBed<PipelineFormTestSubjects> & {
|
|||
actions: ReturnType<typeof getFormActions>;
|
||||
};
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [getCreatePath()],
|
||||
componentRoutePath: ROUTES.create,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig, TestBed } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest';
|
||||
import { PipelinesEdit } from '../../../public/application/sections/pipelines_edit';
|
||||
import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
|
@ -28,7 +28,7 @@ export const PIPELINE_TO_EDIT = {
|
|||
],
|
||||
};
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [getEditPath({ pipelineName: PIPELINE_TO_EDIT.name })],
|
||||
componentRoutePath: ROUTES.edit,
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { PipelinesList } from '../../../public/application/sections/pipelines_list';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
import { getListPath, ROUTES } from '../../../public/application/services/navigation';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [getListPath()],
|
||||
componentRoutePath: ROUTES.list,
|
||||
|
|
|
@ -7,12 +7,18 @@
|
|||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, findTestSubject, TestBed, TestBedConfig, delay } from '@kbn/test/jest';
|
||||
import {
|
||||
registerTestBed,
|
||||
findTestSubject,
|
||||
TestBed,
|
||||
AsyncTestBedConfig,
|
||||
delay,
|
||||
} from '@kbn/test/jest';
|
||||
import { SnapshotRestoreHome } from '../../../public/application/sections/home/home';
|
||||
import { BASE_PATH } from '../../../public/application/constants';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`${BASE_PATH}/repositories`],
|
||||
componentRoutePath: `${BASE_PATH}/:section(repositories|snapshots)/:repositoryName?/:snapshotId*`,
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { PolicyAdd } from '../../../public/application/sections/policy_add';
|
||||
import { formSetup, PolicyFormTestSubjects } from './policy_form.helpers';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: ['/add_policy'],
|
||||
componentRoutePath: '/add_policy',
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { PolicyEdit } from '../../../public/application/sections/policy_edit';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
import { POLICY_NAME } from './constant';
|
||||
import { formSetup, PolicyFormTestSubjects } from './policy_form.helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/edit_policy/${POLICY_NAME}`],
|
||||
componentRoutePath: '/edit_policy/:name',
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { RepositoryEdit } from '../../../public/application/sections/repository_edit';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
import { REPOSITORY_NAME } from './constant';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/${REPOSITORY_NAME}`],
|
||||
componentRoutePath: '/:name',
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
*/
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { RestoreSnapshot } from '../../../public/application/sections/restore_snapshot';
|
||||
import { WithAppDependencies } from './setup_environment';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: ['/add_policy'],
|
||||
componentRoutePath: '/add_policy',
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
|
||||
import { App } from '../../../public/application/app';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/overview`],
|
||||
componentRoutePath: '/overview',
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
*/
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { EsDeprecations } from '../../../public/application/components/es_deprecations';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: ['/es_deprecations'],
|
||||
componentRoutePath: '/es_deprecations',
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { registerTestBed, TestBed, TestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest';
|
||||
import { KibanaDeprecations } from '../../../public/application/components';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: ['/kibana_deprecations'],
|
||||
componentRoutePath: '/kibana_deprecations',
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
*/
|
||||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { Overview } from '../../../public/application/components/overview';
|
||||
import { WithAppDependencies } from '../helpers';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`/overview`],
|
||||
componentRoutePath: '/overview',
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit';
|
||||
import { registerRouter } from '../../../public/application/lib/navigation';
|
||||
import { ROUTES, WATCH_TYPES } from '../../../common/constants';
|
||||
import { withAppContext } from './app_context.mock';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
onRouter: (router) => registerRouter(router),
|
||||
initialEntries: [`${ROUTES.API_ROOT}/watches/new-watch/${WATCH_TYPES.JSON}`],
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit';
|
||||
import { registerRouter } from '../../../public/application/lib/navigation';
|
||||
import { ROUTES, WATCH_TYPES } from '../../../common/constants';
|
||||
import { withAppContext } from './app_context.mock';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
onRouter: (router) => registerRouter(router),
|
||||
initialEntries: [`${ROUTES.API_ROOT}/watches/new-watch/${WATCH_TYPES.THRESHOLD}`],
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit';
|
||||
import { registerRouter } from '../../../public/application/lib/navigation';
|
||||
import { ROUTES } from '../../../common/constants';
|
||||
import { WATCH_ID } from './jest_constants';
|
||||
import { withAppContext } from './app_context.mock';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
onRouter: (router) => registerRouter(router),
|
||||
initialEntries: [`${ROUTES.API_ROOT}/watches/watch/${WATCH_ID}/edit`],
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, findTestSubject, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, findTestSubject, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { WatchList } from '../../../public/application/sections/watch_list/components/watch_list';
|
||||
import { ROUTES, REFRESH_INTERVALS } from '../../../common/constants';
|
||||
import { withAppContext } from './app_context.mock';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`${ROUTES.API_ROOT}/watches`],
|
||||
},
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
import { act } from 'react-dom/test-utils';
|
||||
|
||||
import { registerTestBed, findTestSubject, TestBed, TestBedConfig } from '@kbn/test/jest';
|
||||
import { registerTestBed, findTestSubject, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
|
||||
import { WatchStatus } from '../../../public/application/sections/watch_status/components/watch_status';
|
||||
import { ROUTES } from '../../../common/constants';
|
||||
import { WATCH_ID } from './jest_constants';
|
||||
import { withAppContext } from './app_context.mock';
|
||||
|
||||
const testBedConfig: TestBedConfig = {
|
||||
const testBedConfig: AsyncTestBedConfig = {
|
||||
memoryRouter: {
|
||||
initialEntries: [`${ROUTES.API_ROOT}/watches/watch/${WATCH_ID}/status`],
|
||||
componentRoutePath: `${ROUTES.API_ROOT}/watches/watch/:id/status`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue