From 63013b9dffae9e6b4e5f0acf3cb8530ba5749bd0 Mon Sep 17 00:00:00 2001 From: Milton Hultgren Date: Thu, 3 Feb 2022 09:13:07 +0100 Subject: [PATCH 01/34] [Stack Monitoring] Align text size of offline cells with metric cells (#124237) * [Stack Monitoring] Align text size of offline cells with metric cells (#124235) * Update snap for cells test --- .../nodes/__snapshots__/cells.test.js.snap | 2 +- .../components/elasticsearch/nodes/cells.js | 148 +++++++++--------- 2 files changed, 71 insertions(+), 79 deletions(-) diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap index ce94dd2a61a80..5535520c67a8e 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap @@ -2,7 +2,7 @@ exports[`Node Listing Metric Cell should format N/A as the metric for an offline node 1`] = `
N/A
diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js index 528b3bed3df7b..1b6121f278496 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js @@ -27,7 +27,7 @@ const TRENDING_UP = i18n.translate('xpack.monitoring.elasticsearch.node.cells.tr }); function OfflineCell() { - return
N/A
; + return
N/A
; } const getDirection = (slope) => { @@ -56,88 +56,80 @@ function MetricCell({ isOnline, metric = {}, isPercent, ...props }) { const onButtonClick = () => setIsPopoverOpen((isPopoverOpen) => !isPopoverOpen); const closePopover = () => setIsPopoverOpen(false); - if (isOnline) { - const { lastVal, maxVal, minVal, slope } = get(metric, 'summary', {}); - const format = get(metric, 'metric.format'); - const units = get(metric, 'metric.units'); + if (!isOnline) { + return ; + } - const tooltipItems = [ - { - title: i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.trending', { - defaultMessage: 'Trending', - }), - description: getDirection(slope), - }, - { - title: i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.max', { - defaultMessage: 'Max value', - }), - description: metricVal(maxVal, format, isPercent, units), - }, - { - title: i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.min', { - defaultMessage: 'Min value', - }), - description: metricVal(minVal, format, isPercent, units), - }, - ]; + const { lastVal, maxVal, minVal, slope } = get(metric, 'summary', {}); + const format = get(metric, 'metric.format'); + const units = get(metric, 'metric.units'); - const iconLabel = i18n.translate( - 'xpack.monitoring.elasticsearch.node.cells.tooltip.iconLabel', - { - defaultMessage: 'More information about this metric', - } - ); + const tooltipItems = [ + { + title: i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.trending', { + defaultMessage: 'Trending', + }), + description: getDirection(slope), + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.max', { + defaultMessage: 'Max value', + }), + description: metricVal(maxVal, format, isPercent, units), + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.min', { + defaultMessage: 'Min value', + }), + description: metricVal(minVal, format, isPercent, units), + }, + ]; - const button = ( - - ); + const iconLabel = i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.iconLabel', { + defaultMessage: 'More information about this metric', + }); - return ( - - - - - - -
- - - - {i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.preface', { - defaultMessage: 'Applies to current time period', - })} - -
-
-
- - {metricVal(lastVal, format, isPercent)} - -
-
-
- ); - } + const button = ( + + ); - return ; + return ( + + + + + + +
+ + + + {i18n.translate('xpack.monitoring.elasticsearch.node.cells.tooltip.preface', { + defaultMessage: 'Applies to current time period', + })} + +
+
+
+ + {metricVal(lastVal, format, isPercent)} + +
+
+
+ ); } export { OfflineCell, MetricCell }; From afbe790725bd7e99bcba2eb880f71bd40e973e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopyci=C5=84ski?= Date: Thu, 3 Feb 2022 09:44:29 +0100 Subject: [PATCH 02/34] [Osquery] Update cypress runner to latest Fleet changes (#124398) --- .../osquery/cypress/tasks/integrations.ts | 4 +- x-pack/test/osquery_cypress/agent.ts | 15 ++---- .../test/osquery_cypress/artifact_manager.ts | 9 ++-- x-pack/test/osquery_cypress/fleet_server.ts | 46 +++++++++++++------ x-pack/test/osquery_cypress/runner.ts | 41 ++++++++++------- x-pack/test/osquery_cypress/users.ts | 4 +- 6 files changed, 69 insertions(+), 50 deletions(-) diff --git a/x-pack/plugins/osquery/cypress/tasks/integrations.ts b/x-pack/plugins/osquery/cypress/tasks/integrations.ts index 673f2091760a6..ebf8668483d1c 100644 --- a/x-pack/plugins/osquery/cypress/tasks/integrations.ts +++ b/x-pack/plugins/osquery/cypress/tasks/integrations.ts @@ -13,10 +13,10 @@ import { DATA_COLLECTION_SETUP_STEP, } from '../screens/integrations'; -export const addIntegration = (agent = 'Default fleet') => { +export const addIntegration = (agentPolicy = 'Default Fleet Server policy') => { cy.getBySel(ADD_POLICY_BTN).click(); cy.getBySel(DATA_COLLECTION_SETUP_STEP).find('.euiLoadingSpinner').should('not.exist'); - cy.getBySel('comboBoxInput').click().type(`${agent} {downArrow} {enter}`); + cy.getBySel('agentPolicySelect').select(agentPolicy); cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).click(); // sometimes agent is assigned to default policy, sometimes not closeModalIfVisible(); diff --git a/x-pack/test/osquery_cypress/agent.ts b/x-pack/test/osquery_cypress/agent.ts index 1838d9df8b3e2..c0e5b2374889d 100644 --- a/x-pack/test/osquery_cypress/agent.ts +++ b/x-pack/test/osquery_cypress/agent.ts @@ -11,11 +11,12 @@ import { ChildProcess, spawn } from 'child_process'; import { getLatestVersion } from './artifact_manager'; import { Manager } from './resource_manager'; -interface AgentManagerParams { +export interface AgentManagerParams { user: string; password: string; kibanaUrl: string; esHost: string; + esPort: string; } export class AgentManager extends Manager { @@ -23,19 +24,11 @@ export class AgentManager extends Manager { private log: ToolingLog; private agentProcess?: ChildProcess; private requestOptions: AxiosRequestConfig; - constructor(params: AgentManagerParams, log: ToolingLog) { + constructor(params: AgentManagerParams, log: ToolingLog, requestOptions: AxiosRequestConfig) { super(); this.log = log; this.params = params; - this.requestOptions = { - headers: { - 'kbn-xsrf': 'kibana', - }, - auth: { - username: this.params.user, - password: this.params.password, - }, - }; + this.requestOptions = requestOptions; } public async setup() { diff --git a/x-pack/test/osquery_cypress/artifact_manager.ts b/x-pack/test/osquery_cypress/artifact_manager.ts index 17ba9b0a5517d..498d873747185 100644 --- a/x-pack/test/osquery_cypress/artifact_manager.ts +++ b/x-pack/test/osquery_cypress/artifact_manager.ts @@ -5,10 +5,11 @@ * 2.0. */ -import axios from 'axios'; -import { last } from 'lodash'; +// import axios from 'axios'; +// import { last } from 'lodash'; export async function getLatestVersion(): Promise { - const response: any = await axios('https://artifacts-api.elastic.co/v1/versions'); - return last(response.data.versions as string[]) || '8.1.0-SNAPSHOT'; + return '8.0.0-SNAPSHOT'; + // const response: any = await axios('https://artifacts-api.elastic.co/v1/versions'); + // return last(response.data.versions as string[]) || '8.1.0-SNAPSHOT'; } diff --git a/x-pack/test/osquery_cypress/fleet_server.ts b/x-pack/test/osquery_cypress/fleet_server.ts index fe2b8c7459229..b64b1871637bc 100644 --- a/x-pack/test/osquery_cypress/fleet_server.ts +++ b/x-pack/test/osquery_cypress/fleet_server.ts @@ -7,34 +7,49 @@ import { ChildProcess, spawn } from 'child_process'; import { ToolingLog } from '@kbn/dev-utils'; -import axios from 'axios'; +import axios, { AxiosRequestConfig } from 'axios'; import { Manager } from './resource_manager'; import { getLatestVersion } from './artifact_manager'; - -export interface ElasticsearchConfig { - esHost: string; - user: string; - password: string; - port: string; -} +import { AgentManagerParams } from './agent'; export class FleetManager extends Manager { private fleetProcess?: ChildProcess; - private esConfig: ElasticsearchConfig; + private config: AgentManagerParams; private log: ToolingLog; - constructor(esConfig: ElasticsearchConfig, log: ToolingLog) { + private requestOptions: AxiosRequestConfig; + constructor(config: AgentManagerParams, log: ToolingLog, requestOptions: AxiosRequestConfig) { super(); - this.esConfig = esConfig; + this.config = config; this.log = log; + this.requestOptions = requestOptions; } public async setup(): Promise { this.log.info('Setting fleet up'); return new Promise(async (res, rej) => { try { + // default fleet server policy no longer created by default + const { + data: { + item: { id: policyId }, + }, + } = await axios.post( + `${this.config.kibanaUrl}/api/fleet/agent_policies`, + { + name: 'Default Fleet Server policy', + description: '', + namespace: 'default', + monitoring_enabled: ['logs', 'metrics'], + has_fleet_server: true, + }, + this.requestOptions + ); + const response = await axios.post( - `${this.esConfig.esHost}/_security/service/elastic/fleet-server/credential/token` + `${this.config.kibanaUrl}/api/fleet/service_tokens`, + {}, + this.requestOptions ); - const serviceToken = response.data.token.value; + const serviceToken = response.data.value; const artifact = `docker.elastic.co/beats/elastic-agent:${await getLatestVersion()}`; this.log.info(artifact); @@ -49,12 +64,15 @@ export class FleetManager extends Manager { '--env', 'FLEET_SERVER_ENABLE=true', '--env', - `FLEET_SERVER_ELASTICSEARCH_HOST=http://${host}:${this.esConfig.port}`, + `FLEET_SERVER_ELASTICSEARCH_HOST=http://${host}:${this.config.esPort}`, '--env', `FLEET_SERVER_SERVICE_TOKEN=${serviceToken}`, + '--env', + `FLEET_SERVER_POLICY=${policyId}`, '--rm', artifact, ]; + this.log.info('docker ' + args.join(' ')); this.fleetProcess = spawn('docker', args, { stdio: 'inherit', }); diff --git a/x-pack/test/osquery_cypress/runner.ts b/x-pack/test/osquery_cypress/runner.ts index a72eed0bb8c93..3f4855217de37 100644 --- a/x-pack/test/osquery_cypress/runner.ts +++ b/x-pack/test/osquery_cypress/runner.ts @@ -12,7 +12,10 @@ import { withProcRunner } from '@kbn/dev-utils'; import { FtrProviderContext } from './ftr_provider_context'; -import { AgentManager } from './agent'; +import { + // AgentManager, + AgentManagerParams, +} from './agent'; import { FleetManager } from './fleet_server'; async function withFleetAgent( @@ -23,25 +26,29 @@ async function withFleetAgent( const config = getService('config'); const esHost = Url.format(config.get('servers.elasticsearch')); - const esConfig = { + const params: AgentManagerParams = { user: config.get('servers.elasticsearch.username'), password: config.get('servers.elasticsearch.password'), esHost, - port: config.get('servers.elasticsearch.port'), + esPort: config.get('servers.elasticsearch.port'), + kibanaUrl: Url.format({ + protocol: config.get('servers.kibana.protocol'), + hostname: config.get('servers.kibana.hostname'), + port: config.get('servers.kibana.port'), + }), }; - const fleetManager = new FleetManager(esConfig, log); - - const agentManager = new AgentManager( - { - ...esConfig, - kibanaUrl: Url.format({ - protocol: config.get('servers.kibana.protocol'), - hostname: config.get('servers.kibana.hostname'), - port: config.get('servers.kibana.port'), - }), + const requestOptions = { + headers: { + 'kbn-xsrf': 'kibana', }, - log - ); + auth: { + username: params.user, + password: params.password, + }, + }; + const fleetManager = new FleetManager(params, log, requestOptions); + + // const agentManager = new AgentManager(params, log, requestOptions); // Since the managers will create uncaughtException event handlers we need to exit manually process.on('uncaughtException', (err) => { @@ -50,13 +57,13 @@ async function withFleetAgent( process.exit(1); }); - await agentManager.setup(); + // await agentManager.setup(); await fleetManager.setup(); try { await runner({}); } finally { fleetManager.cleanup(); - agentManager.cleanup(); + // agentManager.cleanup(); } } diff --git a/x-pack/test/osquery_cypress/users.ts b/x-pack/test/osquery_cypress/users.ts index bfe8abfd8452f..cdeea3ddde122 100644 --- a/x-pack/test/osquery_cypress/users.ts +++ b/x-pack/test/osquery_cypress/users.ts @@ -5,7 +5,7 @@ * 2.0. */ import axios from 'axios'; -import { ElasticsearchConfig } from './fleet_server'; +import { AgentManagerParams } from './agent'; interface Roles { [roleName: string]: { @@ -83,7 +83,7 @@ export const USERS: Users = { }, }; -export const setupUsers = async (config: ElasticsearchConfig) => { +export const setupUsers = async (config: AgentManagerParams) => { const { esHost, user: username, password } = config; const params = { auth: { username, password }, From 2a933111217445ad2477c28aa52973ca73221c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Thu, 3 Feb 2022 10:33:38 +0100 Subject: [PATCH 03/34] [Security Solution][Endpoint] Removes Eslint rule exception extracting code outside component (#124167) * Removes eslint rule exception extractig code outisde component * Change function params to be an object * Adds default values Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../view/host_isolation_exceptions_list.tsx | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx index b3dcc4a0fbc97..5af8863f3a5cc 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx @@ -50,7 +50,21 @@ type HostIsolationExceptionPaginatedContent = PaginatedContentProps< typeof ExceptionItem >; -/* eslint-disable complexity */ +const getPaginationObject = ({ + total = 0, + perPage = MANAGEMENT_DEFAULT_PAGE_SIZE, + page = 1, +}: { + total?: number; + perPage?: number; + page?: number; +}) => ({ + totalItemCount: total, + pageSize: perPage, + pageSizeOptions: [...MANAGEMENT_PAGE_SIZE_OPTIONS], + pageIndex: page - 1, +}); + export const HostIsolationExceptionsList = () => { const history = useHistory(); const privileges = useUserPrivileges().endpointPrivileges; @@ -102,12 +116,11 @@ export const HostIsolationExceptionsList = () => { }, }); - const pagination = { - totalItemCount: data?.total ?? 0, - pageSize: data?.per_page ?? MANAGEMENT_DEFAULT_PAGE_SIZE, - pageSizeOptions: [...MANAGEMENT_PAGE_SIZE_OPTIONS], - pageIndex: (data?.page ?? 1) - 1, - }; + const pagination = getPaginationObject({ + total: data?.total, + perPage: data?.per_page, + page: data?.page, + }); const listItems = data?.data || []; const allListItems = allData?.data || []; From 5e3d0b299c2f96560f67605582b6622fc513a5db Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Thu, 3 Feb 2022 10:34:03 +0100 Subject: [PATCH 04/34] [Remote Clusters] Fix table filtering when there are clusters with proxy mode (#124220) * Fix table search for clusters with proxy mode * commit using @elastic.co * Fix tests and add docs * Add tests for different kinds of search --- .../list/remote_clusters_list.test.js | 61 +++++++++++++++++-- .../remote_cluster_table.js | 18 +++++- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js b/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js index 209c224618f78..a6987fa19d1ee 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.test.js @@ -77,6 +77,51 @@ describe('', () => { }); }); + describe('can search', () => { + let table; + let component; + let form; + + const remoteClusters = [ + { + name: 'simple_remote_cluster', + seeds: ['127.0.0.1:2000', '127.0.0.2:3000'], + }, + { + name: 'remote_cluster_with_proxy', + proxyAddress: '192.168.0.1:80', + mode: PROXY_MODE, + }, + ]; + + beforeEach(async () => { + httpRequestsMockHelpers.setLoadRemoteClustersResponse(remoteClusters); + + await act(async () => { + ({ table, component, form } = setup()); + }); + + component.update(); + }); + + test('without any search params it should show all clusters', () => { + const { tableCellsValues } = table.getMetaData('remoteClusterListTable'); + expect(tableCellsValues.length).toBe(2); + }); + + test('search by seed works', () => { + form.setInputValue('remoteClusterSearch', 'simple'); + const { tableCellsValues } = table.getMetaData('remoteClusterListTable'); + expect(tableCellsValues.length).toBe(1); + }); + + test('search by proxyAddress works', () => { + form.setInputValue('remoteClusterSearch', 'proxy'); + const { tableCellsValues } = table.getMetaData('remoteClusterListTable'); + expect(tableCellsValues.length).toBe(1); + }); + }); + describe('when there are multiple pages of remote clusters', () => { let table; let actions; @@ -91,10 +136,18 @@ describe('', () => { ]; for (let i = 0; i < 29; i++) { - remoteClusters.push({ - name: `name${i}`, - seeds: [], - }); + if (i % 2 === 0) { + remoteClusters.push({ + name: `cluster-${i}`, + seeds: [], + }); + } else { + remoteClusters.push({ + name: `cluster_with_proxy-${i}`, + proxyAddress: `127.0.0.1:10${i}`, + mode: PROXY_MODE, + }); + } } beforeEach(async () => { diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js index 0b3a272f5bdc4..b53c735ef9fbb 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js @@ -31,13 +31,22 @@ const getFilteredClusters = (clusters, queryText) => { const normalizedSearchText = queryText.toLowerCase(); return clusters.filter((cluster) => { - const { name, seeds } = cluster; + const { name, seeds, proxyAddress } = cluster; const normalizedName = name.toLowerCase(); + if (normalizedName.toLowerCase().includes(normalizedSearchText)) { return true; } - return seeds.some((seed) => seed.includes(normalizedSearchText)); + if (proxyAddress && proxyAddress.toLowerCase().includes(normalizedSearchText)) { + return true; + } + + if (seeds) { + return seeds.some((seed) => seed.includes(normalizedSearchText)); + } + + return false; }); } else { return clusters; @@ -81,6 +90,11 @@ export class RemoteClusterTable extends Component { } onSearch = ({ query }) => { + // There's no need to update the state if there arent any search params + if (!query) { + return; + } + const { clusters } = this.props; const { text } = query; From d90ac6893eb8c15cc32ff3a09f81dea99c1bd375 Mon Sep 17 00:00:00 2001 From: Ashokaditya <1849116+ashokaditya@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:04:28 +0100 Subject: [PATCH 05/34] [Security Solution][Endpoint] Fix data generator for event filter artifact (#124333) * fix data generator for event filter refs elastic/kibana/pull/124272 elastic/security-team/issues/2906 * use named constants for effect_scopes review change * use ExceptionsListItemGenerator for fake evenFilter data review changes * use custom values --- .../data_generators/event_filter_generator.ts | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts index 6c827d763bb34..daf96a3149649 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filter_generator.ts @@ -8,24 +8,30 @@ import type { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { ENDPOINT_EVENT_FILTERS_LIST_ID } from '@kbn/securitysolution-list-constants'; import { BaseDataGenerator } from './base_data_generator'; -import { getCreateExceptionListItemSchemaMock } from '../../../../lists/common/schemas/request/create_exception_list_item_schema.mock'; +import { ExceptionsListItemGenerator } from './exceptions_list_item_generator'; +import { BY_POLICY_ARTIFACT_TAG_PREFIX, GLOBAL_ARTIFACT_TAG } from '../service/artifacts'; -const EFFECT_SCOPE_TYPES = ['policy:', 'policy:all']; +const EFFECT_SCOPE_TYPES = [BY_POLICY_ARTIFACT_TAG_PREFIX, GLOBAL_ARTIFACT_TAG]; export class EventFilterGenerator extends BaseDataGenerator { generate(): CreateExceptionListItemSchema { - const overrides: Partial = { - name: `generator event ${this.randomString(5)}`, - list_id: ENDPOINT_EVENT_FILTERS_LIST_ID, - item_id: `generator_endpoint_event_filter_${this.randomUUID()}`, - os_types: [this.randomOSFamily()] as CreateExceptionListItemSchema['os_types'], - tags: [this.randomChoice(EFFECT_SCOPE_TYPES)], - namespace_type: 'agnostic', - meta: undefined, - }; - - return Object.assign>( - getCreateExceptionListItemSchemaMock(), - overrides + const eventFilterGenerator = new ExceptionsListItemGenerator(); + const eventFilterData: CreateExceptionListItemSchema = eventFilterGenerator.generateEventFilter( + { + name: `Generated event ${this.randomString(5)}`, + item_id: `generator_endpoint_event_filter_${this.randomUUID()}`, + list_id: ENDPOINT_EVENT_FILTERS_LIST_ID, + os_types: [this.randomOSFamily()] as CreateExceptionListItemSchema['os_types'], + tags: [this.randomChoice(EFFECT_SCOPE_TYPES)], + _version: undefined, + created_at: undefined, + created_by: undefined, + id: undefined, + tie_breaker_id: undefined, + updated_at: undefined, + updated_by: undefined, + } ); + + return eventFilterData; } } From 9c5ec89eedd221797815ad33612842c43ae68966 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Thu, 3 Feb 2022 11:49:34 +0100 Subject: [PATCH 06/34] [ML] Transforms: Stabilize tests (#124373) Stabilizes editing input fields: Improved to fail early by always asserting the original selector based element and not the clicked input one. Adds an option that allows to enforce a check that the clicked element has the data subject selector attribute itself. This allows too to fail early (and trigger a retry) if the wrong element was clicked. Additionally fixes displaying the `destinationIngestPipeline` in the form summary if one is selected. --- .../step_details/step_details_summary.tsx | 14 +++++++ .../test/functional/apps/transform/cloning.ts | 3 +- .../test/functional/services/ml/common_ui.ts | 39 +++++++++++++++---- .../functional/services/transform/wizard.ts | 1 + 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx index 60423e0eb4eb0..ccf65074be8be 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx @@ -26,6 +26,7 @@ export const StepDetailsSummary: FC = React.memo((props transformFrequency, transformSettingsMaxPageSearchSize, destinationIndex, + destinationIngestPipeline, touched, indexPatternTimeField, } = props; @@ -78,6 +79,19 @@ export const StepDetailsSummary: FC = React.memo((props )} + {destinationIngestPipeline !== undefined && destinationIngestPipeline !== '' && ( + + {destinationIngestPipeline} + + )} + {isContinuousModeEnabled && ( { await transform.api.deleteIndices(testData.destinationIndex); await transform.testResources.deleteIndexPatternByTitle(testData.destinationIndex); diff --git a/x-pack/test/functional/services/ml/common_ui.ts b/x-pack/test/functional/services/ml/common_ui.ts index 65621c4959d37..cb9ef179f0626 100644 --- a/x-pack/test/functional/services/ml/common_ui.ts +++ b/x-pack/test/functional/services/ml/common_ui.ts @@ -8,12 +8,15 @@ import expect from '@kbn/expect'; import { ProvidedType } from '@kbn/test'; +import { WebElementWrapper } from 'test/functional/services/lib/web_element_wrapper'; + import { FtrProviderContext } from '../../ftr_provider_context'; import type { CanvasElementColorStats } from '../canvas_element'; export interface SetValueOptions { clearWithKeyboard?: boolean; + enforceDataTestSubj?: boolean; typeCharByChar?: boolean; } @@ -39,24 +42,46 @@ export function MachineLearningCommonUIProvider({ options: SetValueOptions = {} ): Promise { return await retry.try(async () => { - const { clearWithKeyboard = false, typeCharByChar = false } = options; + const { + clearWithKeyboard = false, + enforceDataTestSubj = false, + typeCharByChar = false, + } = options; log.debug(`TestSubjects.setValueWithChecks(${selector}, ${text})`); await testSubjects.click(selector); + // in case the input element is actually a child of the testSubject, we // call clearValue() and type() on the element that is focused after // clicking on the testSubject - const input = await find.activeElement(); + let input: WebElementWrapper; + if (enforceDataTestSubj) { + await retry.tryForTime(5000, async () => { + await testSubjects.click(selector); + input = await find.activeElement(); + const currentDataTestSubj = await input.getAttribute('data-test-subj'); + if (currentDataTestSubj === selector) { + return true; + } else { + throw new Error( + `Expected input data-test-subj to be ${selector}, but got value '${currentDataTestSubj}'` + ); + } + }); + } else { + await testSubjects.click(selector); + input = await find.activeElement(); + } // make sure that clearing the element's value works await retry.tryForTime(5000, async () => { - let currentValue = await input.getAttribute('value'); + let currentValue = await testSubjects.getAttribute(selector, 'value'); if (currentValue !== '') { if (clearWithKeyboard === true) { await input.clearValueWithKeyboard(); } else { await input.clearValue(); } - currentValue = await input.getAttribute('value'); + currentValue = await testSubjects.getAttribute(selector, 'value'); } if (currentValue === '') { @@ -69,11 +94,11 @@ export function MachineLearningCommonUIProvider({ // make sure that typing a character really adds that character to the input value for (const chr of text) { await retry.tryForTime(5000, async () => { - const oldValue = await input.getAttribute('value'); + const oldValue = await testSubjects.getAttribute(selector, 'value'); await input.type(chr, { charByChar: typeCharByChar }); await retry.tryForTime(1000, async () => { - const newValue = await input.getAttribute('value'); + const newValue = await testSubjects.getAttribute(selector, 'value'); if (newValue === `${oldValue}${chr}`) { return true; } else { @@ -88,7 +113,7 @@ export function MachineLearningCommonUIProvider({ // make sure that finally the complete text is entered // this is needed because sometimes the field value is reset while typing // and the above character checking might not catch it due to bad timing - const currentValue = await input.getAttribute('value'); + const currentValue = await testSubjects.getAttribute(selector, 'value'); if (currentValue !== text) { throw new Error( `Expected input '${selector}' to have the value '${text}' (got ${currentValue})` diff --git a/x-pack/test/functional/services/transform/wizard.ts b/x-pack/test/functional/services/transform/wizard.ts index 428a56707b49a..d96b77ef4998a 100644 --- a/x-pack/test/functional/services/transform/wizard.ts +++ b/x-pack/test/functional/services/transform/wizard.ts @@ -682,6 +682,7 @@ export function TransformWizardProvider({ getService, getPageObjects }: FtrProvi async setTransformId(transformId: string) { await ml.commonUI.setValueWithChecks('transformIdInput', transformId, { clearWithKeyboard: true, + enforceDataTestSubj: true, }); await this.assertTransformIdValue(transformId); }, From 640d9e75b86164bc2ecdc5893c4308943bff7413 Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Thu, 3 Feb 2022 12:41:11 +0100 Subject: [PATCH 07/34] [Lens] Various fixes for Lens embeddables (#123587) * :alchemy: Initial investigation * :bug: Mark heatmap respect disableTriggers * :bug: Make table respect the disableTriggers flag * :bug: Add heatmap and gauges to the supported embeddables list * :alchemy: Debug gauges issues and other embeddables * :label: Add missing column type export * :bug: Fix timeRange prop issue + show validation errors when found * :bug: Fix heatmap issue on load * Update x-pack/plugins/lens/public/embeddable/embeddable.test.tsx Co-authored-by: Marta Bondyra Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Marta Bondyra --- .../common/types/expression_renderers.ts | 1 + .../components/heatmap_component.test.tsx | 7 + .../public/components/heatmap_component.tsx | 176 +++++++++------- .../expression_renderers/heatmap_renderer.tsx | 2 + .../components/columns.tsx | 193 +++++++++--------- .../components/table_basic.test.tsx | 51 +++++ .../components/table_basic.tsx | 32 ++- .../components/types.ts | 1 + .../datatable_visualization/expression.tsx | 3 +- .../public/embeddable/embeddable.test.tsx | 48 ++++- .../lens/public/embeddable/embeddable.tsx | 39 +++- .../embeddable/embeddable_component.tsx | 6 +- x-pack/plugins/lens/public/index.ts | 3 + .../operations/index.ts | 1 + .../public/indexpattern_datasource/types.ts | 1 + 15 files changed, 380 insertions(+), 184 deletions(-) diff --git a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts index 1498c04ca1b79..fa8bc5ee2e19d 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts @@ -32,6 +32,7 @@ export type HeatmapRenderProps = HeatmapExpressionProps & { onSelectRange: (data: BrushEvent['data']) => void; paletteService: PaletteRegistry; uiState: PersistedState; + interactive: boolean; }; export interface ColorStop { diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx index 59113e5826d24..105bd339cbca4 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx @@ -99,6 +99,7 @@ describe('HeatmapComponent', function () { onSelectRange: jest.fn(), paletteService: palettesRegistry, formatFactory: formatService.deserialize, + interactive: true, }; }); @@ -266,4 +267,10 @@ describe('HeatmapComponent', function () { ]); expect(wrapperProps.onClickValue).toHaveBeenCalled(); }); + + it('does not add callbacks when not interactive', () => { + const component = shallowWithIntl(); + expect(component.find(Settings).first().prop('onElementClick')).toBeUndefined(); + expect(component.find(Settings).first().prop('onBrushEnd')).toBeUndefined(); + }); }); diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx index 969db9263a4e6..197516ce2db90 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx @@ -135,6 +135,7 @@ export const HeatmapComponent: FC = memo( onSelectRange, paletteService, uiState, + interactive, }) => { const chartTheme = chartsThemeService.useChartsTheme(); const isDarkTheme = chartsThemeService.useDarkMode(); @@ -145,12 +146,15 @@ export const HeatmapComponent: FC = memo( }); const toggleLegend = useCallback(() => { + if (!interactive) { + return; + } setShowLegend((value) => { const newValue = !value; uiState?.set?.('vis.legendOpen', newValue); return newValue; }); - }, [uiState]); + }, [uiState, interactive]); const setColor = useCallback( (newColor: string | null, seriesLabel: string | number) => { @@ -302,77 +306,30 @@ export const HeatmapComponent: FC = memo( }; }); - const onElementClick = ((e: HeatmapElementEvent[]) => { - const cell = e[0][0]; - const { x, y } = cell.datum; - - const xAxisFieldName = xAxisColumn?.meta?.field; - const timeFieldName = isTimeBasedSwimLane ? xAxisFieldName : ''; - - const points = [ - { - row: table.rows.findIndex((r) => r[xAxisColumn.id] === x), - column: xAxisColumnIndex, - value: x, - }, - ...(yAxisColumn - ? [ - { - row: table.rows.findIndex((r) => r[yAxisColumn.id] === y), - column: yAxisColumnIndex, - value: y, - }, - ] - : []), - ]; - - const context: FilterEvent['data'] = { - data: points.map((point) => ({ - row: point.row, - column: point.column, - value: point.value, - table, - })), - timeFieldName, - }; - onClickValue(context); - }) as ElementClickListener; - - const onBrushEnd = (e: HeatmapBrushEvent) => { - const { x, y } = e; + const onElementClick = useCallback( + (e: HeatmapElementEvent[]) => { + const cell = e[0][0]; + const { x, y } = cell.datum; - const xAxisFieldName = xAxisColumn?.meta?.field; - const timeFieldName = isTimeBasedSwimLane ? xAxisFieldName : ''; + const xAxisFieldName = xAxisColumn?.meta?.field; + const timeFieldName = isTimeBasedSwimLane ? xAxisFieldName : ''; - if (isTimeBasedSwimLane) { - const context: BrushEvent['data'] = { - range: x as number[], - table, - column: xAxisColumnIndex, - timeFieldName, - }; - onSelectRange(context); - } else { - const points: Array<{ row: number; column: number; value: string | number }> = []; - - if (yAxisColumn) { - (y as string[]).forEach((v) => { - points.push({ - row: table.rows.findIndex((r) => r[yAxisColumn.id] === v), - column: yAxisColumnIndex, - value: v, - }); - }); - } - if (xAxisColumn) { - (x as string[]).forEach((v) => { - points.push({ - row: table.rows.findIndex((r) => r[xAxisColumn.id] === v), - column: xAxisColumnIndex, - value: v, - }); - }); - } + const points = [ + { + row: table.rows.findIndex((r) => r[xAxisColumn.id] === x), + column: xAxisColumnIndex, + value: x, + }, + ...(yAxisColumn + ? [ + { + row: table.rows.findIndex((r) => r[yAxisColumn.id] === y), + column: yAxisColumnIndex, + value: y, + }, + ] + : []), + ]; const context: FilterEvent['data'] = { data: points.map((point) => ({ @@ -384,8 +341,79 @@ export const HeatmapComponent: FC = memo( timeFieldName, }; onClickValue(context); - } - }; + }, + [ + isTimeBasedSwimLane, + onClickValue, + table, + xAxisColumn?.id, + xAxisColumn?.meta?.field, + xAxisColumnIndex, + yAxisColumn, + yAxisColumnIndex, + ] + ); + + const onBrushEnd = useCallback( + (e: HeatmapBrushEvent) => { + const { x, y } = e; + + const xAxisFieldName = xAxisColumn?.meta?.field; + const timeFieldName = isTimeBasedSwimLane ? xAxisFieldName : ''; + + if (isTimeBasedSwimLane) { + const context: BrushEvent['data'] = { + range: x as number[], + table, + column: xAxisColumnIndex, + timeFieldName, + }; + onSelectRange(context); + } else { + const points: Array<{ row: number; column: number; value: string | number }> = []; + + if (yAxisColumn) { + (y as string[]).forEach((v) => { + points.push({ + row: table.rows.findIndex((r) => r[yAxisColumn.id] === v), + column: yAxisColumnIndex, + value: v, + }); + }); + } + if (xAxisColumn) { + (x as string[]).forEach((v) => { + points.push({ + row: table.rows.findIndex((r) => r[xAxisColumn.id] === v), + column: xAxisColumnIndex, + value: v, + }); + }); + } + + const context: FilterEvent['data'] = { + data: points.map((point) => ({ + row: point.row, + column: point.column, + value: point.value, + table, + })), + timeFieldName, + }; + onClickValue(context); + } + }, + [ + isTimeBasedSwimLane, + onClickValue, + onSelectRange, + table, + xAxisColumn, + xAxisColumnIndex, + yAxisColumn, + yAxisColumnIndex, + ] + ); const themeOverrides: PartialTheme = { legend: { @@ -458,7 +486,7 @@ export const HeatmapComponent: FC = memo( )} = memo( ? new Date(dateHistogramMeta.timeRange.to).getTime() : NaN, }} - onBrushEnd={onBrushEnd as BrushEndListener} + onBrushEnd={interactive ? (onBrushEnd as BrushEndListener) : undefined} />
@@ -58,6 +59,7 @@ export const heatmapRenderer: ( chartsThemeService={getThemeService()} paletteService={getPaletteService()} uiState={handlers.uiState as PersistedState} + interactive={isInteractive()} />
, diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx index a8ba6d553b738..67d95f04869f8 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx @@ -19,23 +19,27 @@ import type { ColumnConfig } from '../../../common/expressions'; export const createGridColumns = ( bucketColumns: string[], table: Datatable, - handleFilterClick: ( - field: string, - value: unknown, - colIndex: number, - rowIndex: number, - negate?: boolean - ) => void, - handleTransposedColumnClick: ( - bucketValues: Array<{ originalBucketColumn: DatatableColumn; value: unknown }>, - negate?: boolean - ) => void, + handleFilterClick: + | (( + field: string, + value: unknown, + colIndex: number, + rowIndex: number, + negate?: boolean + ) => void) + | undefined, + handleTransposedColumnClick: + | (( + bucketValues: Array<{ originalBucketColumn: DatatableColumn; value: unknown }>, + negate?: boolean + ) => void) + | undefined, isReadOnly: boolean, columnConfig: ColumnConfig, visibleColumns: string[], formatFactory: FormatFactory, onColumnResize: (eventData: { columnId: string; width: number | undefined }) => void, - onColumnHide: (eventData: { columnId: string }) => void, + onColumnHide: ((eventData: { columnId: string }) => void) | undefined, alignments: Record ) => { const columnsReverseLookup = table.columns.reduce< @@ -63,86 +67,87 @@ export const createGridColumns = ( const filterable = bucketLookup.has(field); const { name, index: colIndex } = columnsReverseLookup[field]; - const cellActions = filterable - ? [ - ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => { - const { rowValue, contentsIsDefined, cellContent } = getContentData({ - rowIndex, - columnId, - }); - - const filterForText = i18n.translate( - 'xpack.lens.table.tableCellFilter.filterForValueText', - { - defaultMessage: 'Filter for value', - } - ); - const filterForAriaLabel = i18n.translate( - 'xpack.lens.table.tableCellFilter.filterForValueAriaLabel', - { - defaultMessage: 'Filter for value: {cellContent}', - values: { - cellContent, - }, - } - ); - - return ( - contentsIsDefined && ( - { - handleFilterClick(field, rowValue, colIndex, rowIndex); - closePopover(); - }} - iconType="plusInCircle" - > - {filterForText} - - ) - ); - }, - ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => { - const { rowValue, contentsIsDefined, cellContent } = getContentData({ - rowIndex, - columnId, - }); - - const filterOutText = i18n.translate( - 'xpack.lens.table.tableCellFilter.filterOutValueText', - { - defaultMessage: 'Filter out value', - } - ); - const filterOutAriaLabel = i18n.translate( - 'xpack.lens.table.tableCellFilter.filterOutValueAriaLabel', - { - defaultMessage: 'Filter out value: {cellContent}', - values: { - cellContent, - }, - } - ); - - return ( - contentsIsDefined && ( - { - handleFilterClick(field, rowValue, colIndex, rowIndex, true); - closePopover(); - }} - iconType="minusInCircle" - > - {filterOutText} - - ) - ); - }, - ] - : undefined; + const cellActions = + filterable && handleFilterClick + ? [ + ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => { + const { rowValue, contentsIsDefined, cellContent } = getContentData({ + rowIndex, + columnId, + }); + + const filterForText = i18n.translate( + 'xpack.lens.table.tableCellFilter.filterForValueText', + { + defaultMessage: 'Filter for value', + } + ); + const filterForAriaLabel = i18n.translate( + 'xpack.lens.table.tableCellFilter.filterForValueAriaLabel', + { + defaultMessage: 'Filter for value: {cellContent}', + values: { + cellContent, + }, + } + ); + + return ( + contentsIsDefined && ( + { + handleFilterClick(field, rowValue, colIndex, rowIndex); + closePopover(); + }} + iconType="plusInCircle" + > + {filterForText} + + ) + ); + }, + ({ rowIndex, columnId, Component, closePopover }: EuiDataGridColumnCellActionProps) => { + const { rowValue, contentsIsDefined, cellContent } = getContentData({ + rowIndex, + columnId, + }); + + const filterOutText = i18n.translate( + 'xpack.lens.table.tableCellFilter.filterOutValueText', + { + defaultMessage: 'Filter out value', + } + ); + const filterOutAriaLabel = i18n.translate( + 'xpack.lens.table.tableCellFilter.filterOutValueAriaLabel', + { + defaultMessage: 'Filter out value: {cellContent}', + values: { + cellContent, + }, + } + ); + + return ( + contentsIsDefined && ( + { + handleFilterClick(field, rowValue, colIndex, rowIndex, true); + closePopover(); + }} + iconType="minusInCircle" + > + {filterOutText} + + ) + ); + }, + ] + : undefined; const columnArgs = columnConfig.columns.find(({ columnId }) => columnId === field); const isTransposed = Boolean(columnArgs?.originalColumnId); @@ -163,7 +168,7 @@ export const createGridColumns = ( 'data-test-subj': 'lensDatatableResetWidth', isDisabled: initialWidth == null, }); - if (!isTransposed) { + if (!isTransposed && onColumnHide) { additionalActions.push({ color: 'text', size: 'xs', @@ -178,7 +183,7 @@ export const createGridColumns = ( } if (!isReadOnly) { - if (isTransposed && columnArgs?.bucketValues) { + if (isTransposed && columnArgs?.bucketValues && handleTransposedColumnClick) { const bucketValues = columnArgs?.bucketValues; additionalActions.push({ color: 'text', diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx index 46ca179e7cdb4..c01419cc2a91e 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx @@ -121,6 +121,7 @@ describe('DatatableComponent', () => { paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} renderMode="edit" + interactive /> ) ).toMatchSnapshot(); @@ -141,6 +142,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ) ).toMatchSnapshot(); @@ -161,6 +163,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ) ).toMatchSnapshot(); @@ -185,6 +188,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -230,6 +234,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -314,6 +319,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -340,6 +346,36 @@ describe('DatatableComponent', () => { }); }); + test('it should not invoke executeTriggerActions if interactivity is set to false', async () => { + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + ({ convert: (x) => x } as IFieldFormat)} + dispatchEvent={onDispatchEvent} + getType={jest.fn(() => ({ type: 'buckets' } as IAggType))} + renderMode="edit" + paletteService={chartPluginMock.createPaletteRegistry()} + uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive={false} + /> + ); + + wrapper.find('[data-test-subj="dataGridRowCell"]').first().simulate('focus'); + + await waitForWrapperUpdate(wrapper); + + expect(wrapper.find('[data-test-subj="lensDatatableFilterOut"]').exists()).toBe(false); + }); + test('it shows emptyPlaceholder for undefined bucketed data', () => { const { args, data } = sampleArgs(); const emptyData: LensMultiTable = { @@ -364,6 +400,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); expect(component.find(VisualizationContainer)).toHaveLength(1); @@ -387,6 +424,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -437,6 +475,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -467,6 +506,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -495,6 +535,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -541,6 +582,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -567,6 +609,7 @@ describe('DatatableComponent', () => { renderMode="edit" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); // mnake a copy of the data, changing only the name of the first column @@ -602,6 +645,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -637,6 +681,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); expect(wrapper.find('[data-test-subj="lnsDataTable-footer-a"]').exists()).toEqual(false); @@ -672,6 +717,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -706,6 +752,7 @@ describe('DatatableComponent', () => { renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + interactive /> ); @@ -728,6 +775,7 @@ describe('DatatableComponent', () => { paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} renderMode="edit" + interactive /> ); @@ -762,6 +810,7 @@ describe('DatatableComponent', () => { paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} renderMode="edit" + interactive /> ); @@ -786,6 +835,7 @@ describe('DatatableComponent', () => { paletteService: chartPluginMock.createPaletteRegistry(), uiSettings: { get: jest.fn() } as unknown as IUiSettingsClient, renderMode: 'edit' as RenderMode, + interactive: true, }; const wrapper = mount( @@ -821,6 +871,7 @@ describe('DatatableComponent', () => { paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} renderMode="edit" + interactive /> ); diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx index 116331771a9dd..403858f4ba48c 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx @@ -58,6 +58,8 @@ const PAGE_SIZE_OPTIONS = [DEFAULT_PAGE_SIZE, 20, 30, 50, 100]; export const DatatableComponent = (props: DatatableRenderProps) => { const [firstTable] = Object.values(props.data.tables); + const isInteractive = props.interactive; + const [columnConfig, setColumnConfig] = useState({ columns: props.args.columns, sortingColumnId: props.args.sortingColumnId, @@ -160,13 +162,16 @@ export const DatatableComponent = (props: DatatableRenderProps) => { ); const handleFilterClick = useMemo( - () => createGridFilterHandler(firstTableRef, onClickValue), - [firstTableRef, onClickValue] + () => (isInteractive ? createGridFilterHandler(firstTableRef, onClickValue) : undefined), + [firstTableRef, onClickValue, isInteractive] ); const handleTransposedColumnClick = useMemo( - () => createTransposeColumnFilterHandler(onClickValue, untransposedDataRef), - [onClickValue, untransposedDataRef] + () => + isInteractive + ? createTransposeColumnFilterHandler(onClickValue, untransposedDataRef) + : undefined, + [onClickValue, untransposedDataRef, isInteractive] ); const bucketColumns = useMemo( @@ -206,8 +211,11 @@ export const DatatableComponent = (props: DatatableRenderProps) => { ); const onColumnHide = useMemo( - () => createGridHideHandler(columnConfig, setColumnConfig, onEditAction), - [onEditAction, setColumnConfig, columnConfig] + () => + isInteractive + ? createGridHideHandler(columnConfig, setColumnConfig, onEditAction) + : undefined, + [onEditAction, setColumnConfig, columnConfig, isInteractive] ); const isNumericMap: Record = useMemo(() => { @@ -278,7 +286,7 @@ export const DatatableComponent = (props: DatatableRenderProps) => { ); const trailingControlColumns: EuiDataGridControlColumn[] = useMemo(() => { - if (!hasAtLeastOneRowClickAction || !onRowContextMenuClick) { + if (!hasAtLeastOneRowClickAction || !onRowContextMenuClick || !isInteractive) { return []; } return [ @@ -311,7 +319,13 @@ export const DatatableComponent = (props: DatatableRenderProps) => { }, }, ]; - }, [firstTableRef, onRowContextMenuClick, columnConfig, hasAtLeastOneRowClickAction]); + }, [ + firstTableRef, + onRowContextMenuClick, + columnConfig, + hasAtLeastOneRowClickAction, + isInteractive, + ]); const renderCellValue = useMemo( () => @@ -333,7 +347,7 @@ export const DatatableComponent = (props: DatatableRenderProps) => { [visibleColumns] ); - const sorting = useMemo( + const sorting = useMemo( () => createGridSortingConfig(sortBy, sortDirection as LensGridDirection, onEditAction), [onEditAction, sortBy, sortDirection] ); diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/types.ts b/x-pack/plugins/lens/public/datatable_visualization/components/types.ts index e7be5b78545e8..c5d94549b687e 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/types.ts +++ b/x-pack/plugins/lens/public/datatable_visualization/components/types.ts @@ -49,6 +49,7 @@ export type DatatableRenderProps = DatatableProps & { renderMode: RenderMode; paletteService: PaletteRegistry; uiSettings: IUiSettingsClient; + interactive: boolean; /** * A boolean for each table row, which is true if the row active diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx index 2417e395792e0..51b6f7b8332f5 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx @@ -41,7 +41,7 @@ export const getDatatableRenderer = (dependencies: { handlers: ILensInterpreterRenderHandlers ) => { const resolvedGetType = await dependencies.getType; - const { hasCompatibleActions } = handlers; + const { hasCompatibleActions, isInteractive } = handlers; // An entry for each table row, whether it has any actions attached to // ROW_CLICK_TRIGGER trigger. @@ -81,6 +81,7 @@ export const getDatatableRenderer = (dependencies: { paletteService={dependencies.paletteService} getType={resolvedGetType} rowHasRowClickTriggerActions={rowHasRowClickTriggerActions} + interactive={isInteractive()} uiSettings={dependencies.uiSettings} /> diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx index 17e18392e83e9..5ae3cb571bdbb 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx @@ -318,6 +318,52 @@ describe('embeddable', () => { expect(spacesPluginStart.ui.components.getEmbeddableLegacyUrlConflict).toHaveBeenCalled(); }); + it('should not render if timeRange prop is not passed when a referenced data view is time based', async () => { + attributeService = attributeServiceMockFromSavedVis({ + ...savedVis, + references: [ + { type: 'index-pattern', id: '123', name: 'abc' }, + { type: 'index-pattern', id: '123', name: 'def' }, + { type: 'index-pattern', id: '456', name: 'ghi' }, + ], + }); + const embeddable = new Embeddable( + { + timefilter: dataPluginMock.createSetupContract().query.timefilter.timefilter, + attributeService, + expressionRenderer, + basePath, + inspector: inspectorPluginMock.createStartContract(), + indexPatternService: { + get: (id: string) => Promise.resolve({ id, isTimeBased: jest.fn(() => true) }), + } as unknown as IndexPatternsContract, + capabilities: { + canSaveDashboards: true, + canSaveVisualizations: true, + }, + getTrigger, + visualizationMap: {}, + injectFilterReferences: jest.fn(mockInjectFilterReferences), + theme: themeServiceMock.createStartContract(), + documentToExpression: () => + Promise.resolve({ + ast: { + type: 'expression', + chain: [ + { type: 'function', function: 'my', arguments: {} }, + { type: 'function', function: 'expression', arguments: {} }, + ], + }, + errors: undefined, + }), + }, + {} as LensEmbeddableInput + ); + await embeddable.initializeSavedVis({} as LensEmbeddableInput); + embeddable.render(mountpoint); + expect(expressionRenderer).toHaveBeenCalledTimes(0); + }); + it('should initialize output with deduped list of index patterns', async () => { attributeService = attributeServiceMockFromSavedVis({ ...savedVis, @@ -335,7 +381,7 @@ describe('embeddable', () => { basePath, inspector: inspectorPluginMock.createStartContract(), indexPatternService: { - get: (id: string) => Promise.resolve({ id }), + get: (id: string) => Promise.resolve({ id, isTimeBased: () => false }), } as unknown as IndexPatternsContract, capabilities: { canSaveDashboards: true, diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 2878a484686d2..420416dff111c 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -270,11 +270,13 @@ export class Embeddable } switch (this.savedVis.visualizationType) { case 'lnsXY': + case 'lnsHeatmap': return [VIS_EVENT_TO_TRIGGER.filter, VIS_EVENT_TO_TRIGGER.brush]; case 'lnsDatatable': return [VIS_EVENT_TO_TRIGGER.filter, VIS_EVENT_TO_TRIGGER.tableRowContextMenuClick]; case 'lnsPie': return [VIS_EVENT_TO_TRIGGER.filter]; + case 'lnsGauge': case 'lnsMetric': default: return []; @@ -308,6 +310,31 @@ export class Embeddable return ret?.length ? ret : undefined; } + private maybeAddTimeRangeError( + errors: ErrorMessage[] | undefined, + input: LensEmbeddableInput, + indexPatterns: IndexPattern[] + ) { + // if at least one indexPattern is time based, then the Lens embeddable requires the timeRange prop + if ( + input.timeRange == null && + indexPatterns.some((indexPattern) => indexPattern.isTimeBased()) + ) { + return [ + ...(errors || []), + { + shortMessage: i18n.translate('xpack.lens.embeddable.missingTimeRangeParam.shortMessage', { + defaultMessage: `Missing timeRange property`, + }), + longMessage: i18n.translate('xpack.lens.embeddable.missingTimeRangeParam.longMessage', { + defaultMessage: `The timeRange property is required for the given configuration`, + }), + }, + ]; + } + return errors; + } + async initializeSavedVis(input: LensEmbeddableInput) { const unwrapResult: LensUnwrapResult | false = await this.deps.attributeService .unwrapAttributes(input) @@ -334,15 +361,12 @@ export class Embeddable this.expression = expression; this.errors = this.maybeAddConflictError(errors, metaInfo?.sharingSavedObjectProps); - if (this.errors) { - this.logError('validation'); - } await this.initializeOutput(); this.isInitialized = true; } onContainerStateChanged(containerState: LensEmbeddableInput) { - if (this.handleContainerStateChanged(containerState)) this.reload(); + if (this.handleContainerStateChanged(containerState) || this.errors?.length) this.reload(); } handleContainerStateChanged(containerState: LensEmbeddableInput): boolean { @@ -582,6 +606,13 @@ export class Embeddable // the container to pick them up and use them to configure filter bar and // config dropdown correctly. const input = this.getInput(); + + this.errors = this.maybeAddTimeRangeError(this.errors, input, indexPatterns); + + if (this.errors) { + this.logError('validation'); + } + const title = input.hidePanelTitles ? '' : input.title || this.savedVis.title; const savedObjectId = (input as LensByReferenceInput).savedObjectId; this.updateOutput({ diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx b/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx index 94473f2be3613..c4bbe3800ab71 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx @@ -25,6 +25,8 @@ import type { IndexPatternPersistedState } from '../indexpattern_datasource/type import type { XYState } from '../xy_visualization/types'; import type { PieVisualizationState, MetricState } from '../../common/expressions'; import type { DatatableVisualizationState } from '../datatable_visualization/visualization'; +import type { HeatmapVisualizationState } from '../heatmap_visualization/types'; +import type { GaugeVisualizationState } from '../visualizations/gauge/constants'; type LensAttributes = Omit< Document, @@ -48,7 +50,9 @@ export type TypedLensByValueInput = Omit & { | LensAttributes<'lnsXY', XYState> | LensAttributes<'lnsPie', PieVisualizationState> | LensAttributes<'lnsDatatable', DatatableVisualizationState> - | LensAttributes<'lnsMetric', MetricState>; + | LensAttributes<'lnsMetric', MetricState> + | LensAttributes<'lnsHeatmap', HeatmapVisualizationState> + | LensAttributes<'lnsGauge', GaugeVisualizationState>; }; export type EmbeddableComponentProps = (TypedLensByValueInput | LensByReferenceInput) & { diff --git a/x-pack/plugins/lens/public/index.ts b/x-pack/plugins/lens/public/index.ts index 3e622d8ac9312..463687edd3c6c 100644 --- a/x-pack/plugins/lens/public/index.ts +++ b/x-pack/plugins/lens/public/index.ts @@ -28,6 +28,8 @@ export type { } from '../common/expressions'; export type { ValueLabelConfig } from '../common/types'; export type { DatatableVisualizationState } from './datatable_visualization/visualization'; +export type { HeatmapVisualizationState } from './heatmap_visualization/types'; +export type { GaugeVisualizationState } from './visualizations/gauge/constants'; export type { IndexPatternPersistedState, PersistedIndexPatternLayer, @@ -56,6 +58,7 @@ export type { MathIndexPatternColumn, OverallSumIndexPatternColumn, FormulaPublicApi, + StaticValueIndexPatternColumn, } from './indexpattern_datasource/types'; export type { LensEmbeddableInput } from './embeddable'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/index.ts index 4474effc8c8c8..05454c4e0751c 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/index.ts @@ -40,4 +40,5 @@ export type { OverallAverageIndexPatternColumn, FormulaIndexPatternColumn, MathIndexPatternColumn, + StaticValueIndexPatternColumn, } from './definitions'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts index 08786b181f3e7..5bb4d58ed20fa 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts @@ -36,6 +36,7 @@ export type { FormulaIndexPatternColumn, MathIndexPatternColumn, OverallSumIndexPatternColumn, + StaticValueIndexPatternColumn, } from './operations'; export type { FormulaPublicApi } from './operations/definitions/formula/formula_public_api'; From c51daa7daaad08d0cc27887e3d49c1abd5b3dec8 Mon Sep 17 00:00:00 2001 From: Miriam <31922082+MiriamAparicio@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:57:11 +0000 Subject: [PATCH 08/34] Fix validation for duration vars on APM configuration settings (#124336) * Fix validation for duration vars on apm configuration settings * Add unit test and just do the fix if the base package is apm --- .../settings_definition/apm_settings.ts | 8 +-- .../edit_package_policy_page/index.tsx | 7 ++- .../utils/fix_apm_duration_vars.test.ts | 50 +++++++++++++++++++ .../utils/fix_apm_duration_vars.ts | 35 +++++++++++++ .../edit_package_policy_page/utils/index.ts | 1 + .../plugins/fleet/public/constants/index.ts | 8 +++ 6 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.test.ts create mode 100644 x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.ts diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts index ec9f740932376..8adda7b5983f1 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts @@ -78,7 +78,7 @@ export function getApmSettings({ }, { key: 'idle_timeout', - type: 'text', + type: 'duration', labelAppend: OPTIONAL_LABEL, label: i18n.translate( 'xpack.apm.fleet_integration.settings.apm.idleTimeoutLabel', @@ -91,7 +91,7 @@ export function getApmSettings({ }, { key: 'read_timeout', - type: 'text', + type: 'duration', labelAppend: OPTIONAL_LABEL, label: i18n.translate( 'xpack.apm.fleet_integration.settings.apm.readTimeoutLabel', @@ -101,7 +101,7 @@ export function getApmSettings({ }, { key: 'shutdown_timeout', - type: 'text', + type: 'duration', labelAppend: OPTIONAL_LABEL, label: i18n.translate( 'xpack.apm.fleet_integration.settings.apm.shutdownTimeoutLabel', @@ -114,7 +114,7 @@ export function getApmSettings({ }, { key: 'write_timeout', - type: 'text', + type: 'duration', labelAppend: OPTIONAL_LABEL, label: i18n.translate( 'xpack.apm.fleet_integration.settings.apm.writeTimeoutLabel', diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index 4bce393aebb14..8151215c3cced 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -64,10 +64,9 @@ import type { } from '../../../../../../common/types/rest_spec'; import type { PackagePolicyEditExtensionComponentProps } from '../../../types'; import { pkgKeyFromPackageInfo, storedPackagePoliciesToAgentInputs } from '../../../services'; - import { EuiButtonWithTooltip } from '../../../../integrations/sections/epm/screens/detail'; -import { hasUpgradeAvailable } from './utils'; +import { fixApmDurationVars, hasUpgradeAvailable } from './utils'; export const EditPackagePolicyPage = memo(() => { const { @@ -232,6 +231,10 @@ export const EditPackagePolicyForm = memo<{ ...basePolicyInputVars, }; } + // Fix duration vars, if it's a migrated setting, and it's a plain old number with no suffix + if (basePackage.name === 'apm') { + newVars = fixApmDurationVars(newVars); + } return { ...restOfInput, streams: streams.map((stream: any) => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.test.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.test.ts new file mode 100644 index 0000000000000..ab2a8238e7b37 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.test.ts @@ -0,0 +1,50 @@ +/* + * 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 { fixApmDurationVars } from './fix_apm_duration_vars'; + +describe('Edit Package Policy - fixApmDurationVars()', () => { + const mockApmVars = { + idle_timeout: { + type: 'text', + value: '45', + }, + read_timeout: { + type: 'text', + value: '3600', + }, + shutdown_timeout: { + type: 'text', + value: '30s', + }, + max_header_bytes: { + type: 'integer', + value: 3, + }, + url: { + type: 'text', + value: 'http://localhost:8200', + }, + }; + describe('when the APM var is a duration var', () => { + it('adds duration unit suffix to APM duration vars ', () => { + const newVars = fixApmDurationVars(mockApmVars); + expect(newVars.idle_timeout.value).toEqual('45s'); + }); + it('doesnt add the suffix if doesnt end with number', () => { + const newVars = fixApmDurationVars(mockApmVars); + expect(newVars.shutdown_timeout.value).toEqual(mockApmVars.shutdown_timeout.value); + }); + }); + describe('when the APM is not a duration var', () => { + it('keeps the same value', () => { + const newVars = fixApmDurationVars(mockApmVars); + expect(newVars.url.value).toEqual(mockApmVars.url.value); + expect(newVars.max_header_bytes.value).toEqual(mockApmVars.max_header_bytes.value); + }); + }); +}); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.ts new file mode 100644 index 0000000000000..bea92f35f52cc --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/fix_apm_duration_vars.ts @@ -0,0 +1,35 @@ +/* + * 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 type { PackagePolicyConfigRecord } from '../../../../../integrations/types'; +import { DURATION_APM_SETTINGS_VARS } from '../../../../constants'; + +// Fix duration vars, if it's a migrated setting, and it's a plain old number with no suffix, we should assume seconds +export function fixApmDurationVars(vars: PackagePolicyConfigRecord) { + const { IDLE_TIMEOUT, READ_TIMEOUT, SHUTDOWN_TIMEOUT, TAIL_SAMPLING_INTERVAL, WRITE_TIMEOUT } = + DURATION_APM_SETTINGS_VARS; + // convert vars to array, map each key/value pair into another pair + // and then fromEntries gives back the object + return Object.fromEntries( + Object.entries(vars).map((entry: any) => { + if ( + entry[0] === IDLE_TIMEOUT || + entry[0] === READ_TIMEOUT || + entry[0] === SHUTDOWN_TIMEOUT || + entry[0] === TAIL_SAMPLING_INTERVAL || + entry[0] === WRITE_TIMEOUT + ) { + // we add the unit seconds sufix as default + if (/[0-9]+$/.test(entry[1].value)) { + entry[1] = { ...entry[1], value: entry[1].value + 's' }; + return [entry[0], entry[1]]; + } + } + return entry; + }) + ); +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/index.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/index.ts index e8206e9dbbf97..be01b9834a7dc 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/index.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/utils/index.ts @@ -6,3 +6,4 @@ */ export * from './has_upgrade_available'; +export { fixApmDurationVars } from './fix_apm_duration_vars'; diff --git a/x-pack/plugins/fleet/public/constants/index.ts b/x-pack/plugins/fleet/public/constants/index.ts index dddd7552f0151..6fa1a4161a066 100644 --- a/x-pack/plugins/fleet/public/constants/index.ts +++ b/x-pack/plugins/fleet/public/constants/index.ts @@ -29,3 +29,11 @@ export * from './page_paths'; export const INDEX_NAME = '.kibana'; export const CUSTOM_LOGS_INTEGRATION_NAME = 'log'; + +export const DURATION_APM_SETTINGS_VARS = { + IDLE_TIMEOUT: 'idle_timeout', + READ_TIMEOUT: 'read_timeout', + SHUTDOWN_TIMEOUT: 'shutdown_timeout', + TAIL_SAMPLING_INTERVAL: 'tail_sampling_interval', + WRITE_TIMEOUT: 'write_timeout', +}; From e5f8829f4edde75c7e54d7b6919193f3293eb11a Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 3 Feb 2022 13:19:37 +0100 Subject: [PATCH 09/34] [TSVB] Switch default bar width to 0px (#123926) --- .../public/application/visualizations/views/top_n.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/vis_types/timeseries/public/application/visualizations/views/top_n.js b/src/plugins/vis_types/timeseries/public/application/visualizations/views/top_n.js index e9ffcd8bc5a86..6b2b25eed2a03 100644 --- a/src/plugins/vis_types/timeseries/public/application/visualizations/views/top_n.js +++ b/src/plugins/vis_types/timeseries/public/application/visualizations/views/top_n.js @@ -74,10 +74,10 @@ export class TopN extends Component { return {}; }; - static calcInnerBarDivStyles = (item, width, isPositive) => { + static calcInnerBarDivStyles = (item, widthWithUnit, isPositive) => { return { backgroundColor: item.color, - width: width + '%', + width: widthWithUnit, float: isPositive ? 'left' : 'right', }; }; @@ -97,8 +97,7 @@ export class TopN extends Component { const renderMode = TopN.getRenderMode(min, max); const key = `${item.id || item.label}`; const lastValue = getLastValue(item.data); - // if result is empty, all bar need to be colored. - const lastValueFormatted = isEmptyValue(lastValue) ? 1 : lastValue; + const lastValueFormatted = isEmptyValue(lastValue) ? 0 : lastValue; const formatter = item.tickFormatter || this.props.tickFormatter; const isPositiveValue = lastValueFormatted >= 0; @@ -106,6 +105,7 @@ export class TopN extends Component { // if both are 0, the division returns NaN causing unexpected behavior. // For this it defaults to 0 const width = 100 * (Math.abs(lastValueFormatted) / intervalLength) || 0; + const widthWithUnit = isEmptyValue(lastValue) ? '1px' : `${width}%`; const label = item.labelFormatted ? labelDateFormatter(item.labelFormatted) : item.label; const styles = reactcss( { @@ -114,7 +114,7 @@ export class TopN extends Component { ...TopN.calcInnerBarStyles(renderMode, isPositiveValue), }, innerBarValue: { - ...TopN.calcInnerBarDivStyles(item, width, isPositiveValue), + ...TopN.calcInnerBarDivStyles(item, widthWithUnit, isPositiveValue), }, label: { maxWidth: this.state.labelMaxWidth, @@ -154,7 +154,7 @@ export class TopN extends Component { const intervalSettings = this.props.series.reduce( (acc, series, index) => { - const value = getLastValue(series.data) ?? 1; + const value = getLastValue(series.data) ?? 0; return { min: !index || value < acc.min ? value : acc.min, From ed2da3f1838b29c49fca999614dcc5648b3e876a Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 3 Feb 2022 14:35:26 +0200 Subject: [PATCH 10/34] [TSVB] Not creates filter by clicking a series agg timeseries chart split by terms (#124031) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../lib/convert_series_to_datatable.test.ts | 21 +++++++++++++++++++ .../lib/convert_series_to_datatable.ts | 12 ++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts index 3df52223c253a..15151a9e21bc5 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts @@ -210,5 +210,26 @@ describe('convert series to datatables', () => { }); expect(tables.series1.rows).toEqual([...expected1, ...expected2]); }); + + test('for series aggregation split by terms, no column is added', async () => { + const updatedModel = { + ...model, + series: [ + { + ...model.series[0], + metrics: [ + { + field: 'test2', + id: 'series1', + function: 'sum', + type: 'series_agg', + }, + ], + }, + ], + } as TimeseriesVisParams; + const tables = await convertSeriesToDataTable(updatedModel, series, indexPattern); + expect(tables.series1.columns.length).toEqual(2); + }); }); }); diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.ts b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.ts index 19a1910afbe2f..8e7c1694357c8 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.ts +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.ts @@ -9,8 +9,8 @@ import { IndexPattern } from 'src/plugins/data/public'; import { DatatableRow, DatatableColumn, DatatableColumnType } from 'src/plugins/expressions/public'; import { Query } from 'src/plugins/data/common'; import { TimeseriesVisParams } from '../../../types'; -import type { PanelData } from '../../../../common/types'; -import { BUCKET_TYPES } from '../../../../common/enums'; +import type { PanelData, Metric } from '../../../../common/types'; +import { BUCKET_TYPES, TSVB_METRIC_TYPES } from '../../../../common/enums'; import { fetchIndexPattern } from '../../../../common/index_patterns_utils'; import { getDataStart } from '../../../services'; import { X_ACCESSOR_INDEX } from '../../visualizations/constants'; @@ -78,6 +78,10 @@ export const addMetaToColumns = ( }); }; +const hasSeriesAgg = (metrics: Metric[]) => { + return metrics.some((metric) => metric.type === TSVB_METRIC_TYPES.SERIES_AGG); +}; + export const convertSeriesToDataTable = async ( model: TimeseriesVisParams, series: PanelData[], @@ -96,7 +100,9 @@ export const convertSeriesToDataTable = async ( usedIndexPattern = indexPattern; } } - const isGroupedByTerms = layer.split_mode === BUCKET_TYPES.TERMS; + // series aggregation is a special case, splitting by terms doesn't create multiple series per term + const isGroupedByTerms = + layer.split_mode === BUCKET_TYPES.TERMS && !hasSeriesAgg(layer.metrics); const isGroupedByFilters = layer.split_mode === BUCKET_TYPES.FILTERS; const seriesPerLayer = series.filter((s) => s.seriesId === layer.id); let id = X_ACCESSOR_INDEX; From 9d8f817cc5d01fe12390dd08569a3a66501541d5 Mon Sep 17 00:00:00 2001 From: Jonathan Buttner <56361221+jonathan-buttner@users.noreply.github.com> Date: Thu, 3 Feb 2022 07:53:56 -0500 Subject: [PATCH 11/34] adding ignore unavailable and tests (#124401) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../cases/server/services/alerts/index.ts | 1 + .../common/metrics/get_case_metrics_alerts.ts | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/x-pack/plugins/cases/server/services/alerts/index.ts b/x-pack/plugins/cases/server/services/alerts/index.ts index 7444159a00bb0..7f966a471c725 100644 --- a/x-pack/plugins/cases/server/services/alerts/index.ts +++ b/x-pack/plugins/cases/server/services/alerts/index.ts @@ -42,6 +42,7 @@ export class AlertService { const res = await this.scopedClusterClient.search({ index: indices, + ignore_unavailable: true, query: { ids: { values: ids } }, size: 0, aggregations: builtAggs, diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/metrics/get_case_metrics_alerts.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/metrics/get_case_metrics_alerts.ts index c711dff7b55a0..1f58d4b72cea8 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/metrics/get_case_metrics_alerts.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/metrics/get_case_metrics_alerts.ts @@ -100,6 +100,56 @@ export default ({ getService }: FtrProviderContext): void => { }); }); + describe('alert details invalid alerts', () => { + let caseId: string; + + before(async () => { + caseId = await createCaseWithAlerts(); + await esArchiver.load('x-pack/test/functional/es_archives/cases/signals/hosts_users'); + }); + + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/cases/signals/hosts_users'); + await deleteAllCaseItems(es); + }); + + it('ignores failures from alerts that the index does not exist', async () => { + const theCase = await createCase(supertest, getPostCaseRequest()); + + // add an alert that has an index and id do not exist + await createComment({ supertest, caseId: theCase.id, params: postCommentAlertReq }); + + const metrics = await getCaseMetrics({ + supertest, + caseId: theCase.id, + features: ['alerts.users', 'alerts.hosts'], + }); + + expect(metrics.alerts?.hosts).to.eql({ + total: 0, + values: [], + }); + expect(metrics.alerts?.users).to.eql({ + total: 0, + values: [], + }); + }); + + it('returns the accurate metrics for the alerts that have valid indices', async () => { + await createComment({ supertest, caseId, params: postCommentAlertReq }); + + const metrics = await getCaseMetrics({ + supertest, + caseId, + features: ['alerts.users', 'alerts.hosts', 'alerts.count'], + }); + + expect(metrics.alerts?.hosts?.total).to.be(3); + expect(metrics.alerts?.users?.total).to.be(4); + expect(metrics.alerts?.count).to.be(7); + }); + }); + describe('alert count', () => { afterEach(async () => { await deleteAllCaseItems(es); From 045fd78fbd5d4aae8f8f5feafe7e6fac22fe216f Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 3 Feb 2022 15:26:21 +0200 Subject: [PATCH 12/34] [XY] Fixes the percentage format for percentiles series (#124098) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- src/plugins/vis_types/xy/public/to_ast.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/vis_types/xy/public/to_ast.ts b/src/plugins/vis_types/xy/public/to_ast.ts index 9e2c7554aaf7c..9dec2f9af5ba4 100644 --- a/src/plugins/vis_types/xy/public/to_ast.ts +++ b/src/plugins/vis_types/xy/public/to_ast.ts @@ -34,6 +34,7 @@ import { XyVisType } from '../common'; import { getEsaggsFn } from './to_ast_esaggs'; import { TimeRangeBounds } from '../../../data/common'; import { getSeriesParams } from './utils/get_series_params'; +import { getSafeId } from './utils/accessors'; const prepareLabel = (data: Labels) => { const label = buildExpressionFunction('label', { @@ -189,8 +190,9 @@ export const toExpressionAst: VisToExpressionAst = async (vis, params (dimensions.y || []).forEach((yDimension) => { const yAgg = responseAggs[yDimension.accessor]; + const aggId = getSafeId(yAgg.id); const seriesParam = (vis.params.seriesParams || []).find( - (param: any) => param.data.id === yAgg.id + (param: any) => param.data.id === aggId ); if (seriesParam) { const usedValueAxis = (vis.params.valueAxes || []).find( From 9df685acbe15ce97cc3882d89a0d6b3c1a41500e Mon Sep 17 00:00:00 2001 From: Uladzislau Lasitsa Date: Thu, 3 Feb 2022 16:58:18 +0300 Subject: [PATCH 13/34] Fix sorting behavior in color ranges when auto max is enabled (#124489) * Fix soring behavior when auto max is enabled * Add some tests --- .../coloring/color_ranges/utils/utils.test.ts | 14 ++++++++++++++ .../coloring/color_ranges/utils/utils.ts | 11 +++++++++-- .../public/shared_components/coloring/utils.ts | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.test.ts b/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.test.ts index 582ca454f82ce..d0b650eba0140 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.test.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.test.ts @@ -30,6 +30,20 @@ describe('utils', () => { { color: '#ccc', start: 60, end: 80 }, { color: '#bbb', start: 80, end: 90 }, ]); + + colorRanges = [ + { color: '#aaa', start: 55, end: 90 }, + { color: '#bbb', start: 90, end: 60 }, + { color: '#ccc', start: 60, end: Infinity }, + ]; + expect(sortColorRanges(colorRanges)).toEqual([ + { color: '#aaa', start: 55, end: 60 }, + { color: '#ccc', start: 60, end: 90 }, + { color: '#bbb', start: 90, end: Infinity }, + ]); + + colorRanges = [{ color: '#aaa', start: 90, end: 55 }]; + expect(sortColorRanges(colorRanges)).toEqual([{ color: '#aaa', start: 55, end: 90 }]); }); it('calculateMaxStep', () => { diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.ts b/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.ts index 6f0f3d5038916..4c8dd17c77c61 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/utils/utils.ts @@ -27,10 +27,17 @@ export const isLastItem = (accessor: ColorRangeAccessor) => accessor === 'end'; export const sortColorRanges = (colorRanges: ColorRange[]) => { const lastRange = colorRanges[colorRanges.length - 1]; - return [...colorRanges, { start: lastRange.end, color: lastRange.color }] + // we should add last end as new start because we should include it on sorting + return [...colorRanges, { start: lastRange.end, color: lastRange.color, end: undefined }] .sort(({ start: startA }, { start: startB }) => Number(startA) - Number(startB)) .reduce((sortedColorRange, newColorRange, i, array) => { - const color = i === array.length - 2 ? array[i + 1].color : newColorRange.color; + // we should pick correct color for the last range. + // If after sorting we don't change last value we should just take color in array order + // In another case we should get the next one. + let color = newColorRange.color; + if (i === array.length - 2 && array[i + 1].start !== lastRange.end) { + color = array[i + 1].color; + } if (i !== array.length - 1) { sortedColorRange.push({ color, diff --git a/x-pack/plugins/lens/public/shared_components/coloring/utils.ts b/x-pack/plugins/lens/public/shared_components/coloring/utils.ts index d855999ecfcb6..6a90119e4ca71 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/utils.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/utils.ts @@ -414,7 +414,8 @@ export function roundValue(value: number, fractionDigits: number = 2) { export function getStepValue(colorStops: ColorStop[], newColorStops: ColorStop[], max: number) { const length = newColorStops.length; // workout the steps from the last 2 items - const dataStep = newColorStops[length - 1].stop - newColorStops[length - 2].stop || 1; + const dataStep = + length > 1 ? newColorStops[length - 1].stop - newColorStops[length - 2].stop || 1 : 1; let step = Number(dataStep.toFixed(2)); if (max < colorStops[length - 1].stop + step) { const diffToMax = max - colorStops[length - 1].stop; From d421e473c8b8c114c612753790e2bed005e745c8 Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Thu, 3 Feb 2022 08:20:38 -0600 Subject: [PATCH 14/34] [DOCS] Removes tag from 8.0.0-rc2 release notes (#123743) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- docs/CHANGELOG.asciidoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 03bccef3b822e..446c305c03b95 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -20,8 +20,6 @@ Review important information about the {kib} 8.0.0 releases. [[release-notes-8.0.0-rc2]] == {kib} 8.0.0-rc2 -coming::[8.0.0-rc2] - For information about the {kib} 8.0.0-rc2 release, review the following information. [float] From f6a6c8a9c87ee194b44cc800ea31bdffa97f1cee Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Thu, 3 Feb 2022 09:39:41 -0500 Subject: [PATCH 15/34] [Maps][ML] Filter out kbn prop from tooltip (#124300) --- x-pack/plugins/maps/public/index.ts | 2 ++ x-pack/plugins/ml/public/maps/anomaly_source.tsx | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/maps/public/index.ts b/x-pack/plugins/maps/public/index.ts index 5778c8d3b654f..071300b7784fb 100644 --- a/x-pack/plugins/maps/public/index.ts +++ b/x-pack/plugins/maps/public/index.ts @@ -20,6 +20,8 @@ export const plugin: PluginInitializer = ( export { MAP_SAVED_OBJECT_TYPE } from '../common/constants'; export type { PreIndexedShape } from '../common/elasticsearch_util'; +export { GEOJSON_FEATURE_ID_PROPERTY_NAME } from './classes/layers/vector_layer/geojson_vector_layer/assign_feature_ids'; + export type { ITooltipProperty, RenderTooltipContentParams, diff --git a/x-pack/plugins/ml/public/maps/anomaly_source.tsx b/x-pack/plugins/ml/public/maps/anomaly_source.tsx index fa3fce1747a2e..e2d92a730d95a 100644 --- a/x-pack/plugins/ml/public/maps/anomaly_source.tsx +++ b/x-pack/plugins/ml/public/maps/anomaly_source.tsx @@ -15,7 +15,7 @@ import { VectorSourceRequestMeta, } from '../../../maps/common'; import { AbstractSourceDescriptor, MapExtent } from '../../../maps/common/descriptor_types'; -import { ITooltipProperty } from '../../../maps/public'; +import { ITooltipProperty, GEOJSON_FEATURE_ID_PROPERTY_NAME } from '../../../maps/public'; import { AnomalySourceField, AnomalySourceTooltipProperty, @@ -247,6 +247,9 @@ export class AnomalySource implements IVectorSource { async getTooltipProperties(properties: { [p: string]: any } | null): Promise { const tooltipProperties: ITooltipProperty[] = []; for (const key in properties) { + if (key === GEOJSON_FEATURE_ID_PROPERTY_NAME) { + continue; + } if (properties.hasOwnProperty(key)) { const label = ANOMALY_SOURCE_FIELDS[key]?.label; if (label) { From ad7c8de75aef8c5890ea4db4e08d1e465cdd8db7 Mon Sep 17 00:00:00 2001 From: "Christiane (Tina) Heiligers" Date: Thu, 3 Feb 2022 07:56:39 -0700 Subject: [PATCH 16/34] Appends the saved objects documents count to the CoreUsageData service (#124308) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../core/server/kibana-plugin-core-server.md | 2 +- ...re-server.mergesavedobjectmigrationmaps.md | 8 ++++++ .../core_usage_data_service.mock.ts | 1 + .../core_usage_data_service.test.ts | 12 ++++++++ .../core_usage_data_service.ts | 28 +++++++++++++++++-- src/core/server/core_usage_data/types.ts | 1 + src/core/server/server.api.md | 1 + .../collectors/core/core_usage_collector.ts | 10 +++++-- src/plugins/telemetry/schema/oss_plugins.json | 10 +++++-- 9 files changed, 65 insertions(+), 8 deletions(-) diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index ede29f5e3d2c8..450af99a5b234 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -244,7 +244,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | --- | --- | | [APP\_WRAPPER\_CLASS](./kibana-plugin-core-server.app_wrapper_class.md) | The class name for top level \*and\* nested application wrappers to ensure proper layout | | [kibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) | Set of helpers used to create KibanaResponse to form HTTP response on an incoming request. Should be returned as a result of [RequestHandler](./kibana-plugin-core-server.requesthandler.md) execution. | -| [mergeSavedObjectMigrationMaps](./kibana-plugin-core-server.mergesavedobjectmigrationmaps.md) | Merges two saved object migration maps. | +| [mergeSavedObjectMigrationMaps](./kibana-plugin-core-server.mergesavedobjectmigrationmaps.md) | Merges two saved object migration maps.If there is a migration for a given version on only one of the maps, that migration function will be used:mergeSavedObjectMigrationMaps({ '1.2.3': f }, { '4.5.6': g }) -> { '1.2.3': f, '4.5.6': g }If there is a migration for a given version on both maps, the migrations will be composed:mergeSavedObjectMigrationMaps({ '1.2.3': f }, { '1.2.3': g }) -> { '1.2.3': (doc, context) => f(g(doc, context), context) } | | [pollEsNodesVersion](./kibana-plugin-core-server.pollesnodesversion.md) | | | [ServiceStatusLevels](./kibana-plugin-core-server.servicestatuslevels.md) | The current "level" of availability of a service. | | [validBodyOutput](./kibana-plugin-core-server.validbodyoutput.md) | The set of valid body.output | diff --git a/docs/development/core/server/kibana-plugin-core-server.mergesavedobjectmigrationmaps.md b/docs/development/core/server/kibana-plugin-core-server.mergesavedobjectmigrationmaps.md index 52d40097ca487..68cd580b57882 100644 --- a/docs/development/core/server/kibana-plugin-core-server.mergesavedobjectmigrationmaps.md +++ b/docs/development/core/server/kibana-plugin-core-server.mergesavedobjectmigrationmaps.md @@ -6,6 +6,14 @@ Merges two saved object migration maps. +If there is a migration for a given version on only one of the maps, that migration function will be used: + +mergeSavedObjectMigrationMaps({ '1.2.3': f }, { '4.5.6': g }) -> { '1.2.3': f, '4.5.6': g } + +If there is a migration for a given version on both maps, the migrations will be composed: + +mergeSavedObjectMigrationMaps({ '1.2.3': f }, { '1.2.3': g }) -> { '1.2.3': (doc, context) => f(g(doc, context), context) } + Signature: ```typescript diff --git a/src/core/server/core_usage_data/core_usage_data_service.mock.ts b/src/core/server/core_usage_data/core_usage_data_service.mock.ts index 331a3bbb9c028..fd8f219fb2d55 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.mock.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.mock.ts @@ -140,6 +140,7 @@ const createStartContractMock = () => { alias: 'test_index', primaryStoreSizeBytes: 1, storeSizeBytes: 1, + savedObjectsDocsCount: 1, }, ], legacyUrlAliases: { diff --git a/src/core/server/core_usage_data/core_usage_data_service.test.ts b/src/core/server/core_usage_data/core_usage_data_service.test.ts index 59f673bbe3dfa..e6e890b1a7dab 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.test.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.test.ts @@ -218,6 +218,11 @@ describe('CoreUsageDataService', () => { }, ], } as any); + elasticsearch.client.asInternalUser.count.mockResolvedValueOnce({ + body: { + count: '15', + }, + } as any); elasticsearch.client.asInternalUser.cat.indices.mockResolvedValueOnce({ body: [ { @@ -229,6 +234,11 @@ describe('CoreUsageDataService', () => { }, ], } as any); + elasticsearch.client.asInternalUser.count.mockResolvedValueOnce({ + body: { + count: '10', + }, + } as any); elasticsearch.client.asInternalUser.search.mockResolvedValueOnce({ body: { hits: { total: { value: 6 } }, @@ -384,6 +394,7 @@ describe('CoreUsageDataService', () => { "docsCount": 10, "docsDeleted": 10, "primaryStoreSizeBytes": 2000, + "savedObjectsDocsCount": "15", "storeSizeBytes": 1000, }, Object { @@ -391,6 +402,7 @@ describe('CoreUsageDataService', () => { "docsCount": 20, "docsDeleted": 20, "primaryStoreSizeBytes": 4000, + "savedObjectsDocsCount": "10", "storeSizeBytes": 2000, }, ], diff --git a/src/core/server/core_usage_data/core_usage_data_service.ts b/src/core/server/core_usage_data/core_usage_data_service.ts index 0665aed0e1950..824bfdffdceec 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.ts @@ -131,11 +131,11 @@ export class CoreUsageDataService return acc.add(index); }, new Set()) .values() - ).map((index) => { + ).map(async (index) => { // The _cat/indices API returns the _index_ and doesn't return a way // to map back from the index to the alias. So we have to make an API - // call for every alias - return elasticsearch.client.asInternalUser.cat + // call for every alias. The document count is the lucene document count. + const catIndicesResults = await elasticsearch.client.asInternalUser.cat .indices({ index, format: 'JSON', @@ -143,6 +143,7 @@ export class CoreUsageDataService }) .then(({ body }) => { const stats = body[0]; + return { alias: kibanaOrTaskManagerIndex(index, kibanaIndex), docsCount: stats['docs.count'] ? parseInt(stats['docs.count'], 10) : 0, @@ -153,6 +154,27 @@ export class CoreUsageDataService : 0, }; }); + // We use the GET /_count API to get the number of saved objects + // to monitor if the cluster will hit the scalling limit of saved object migrations + const savedObjectsCounts = await elasticsearch.client.asInternalUser + .count({ + index, + }) + .then(({ body }) => { + return { + savedObjectsDocsCount: body.count ? body.count : 0, + }; + }); + this.logger.debug( + `Lucene documents count ${catIndicesResults.docsCount} from index ${catIndicesResults.alias}` + ); + this.logger.debug( + `Saved objects documents count ${savedObjectsCounts.savedObjectsDocsCount} from index ${catIndicesResults.alias}` + ); + return { + ...catIndicesResults, + ...savedObjectsCounts, + }; }) ); } diff --git a/src/core/server/core_usage_data/types.ts b/src/core/server/core_usage_data/types.ts index 59e220fac4efe..0b09444da493d 100644 --- a/src/core/server/core_usage_data/types.ts +++ b/src/core/server/core_usage_data/types.ts @@ -177,6 +177,7 @@ export interface CoreServicesUsageData { docsDeleted: number; storeSizeBytes: number; primaryStoreSizeBytes: number; + savedObjectsDocsCount: number; }[]; legacyUrlAliases: { activeCount: number; diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 2f68b82ac5635..a722e6eb98b02 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -426,6 +426,7 @@ export interface CoreServicesUsageData { docsDeleted: number; storeSizeBytes: number; primaryStoreSizeBytes: number; + savedObjectsDocsCount: number; }[]; legacyUrlAliases: { activeCount: number; diff --git a/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts index b1cf0ecd2213e..a208832baf719 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts @@ -355,14 +355,14 @@ export function getCoreUsageCollector( type: 'long', _meta: { description: - 'The number of documents in the index, including hidden nested documents.', + 'The number of lucene documents in the index, including hidden nested documents.', }, }, docsDeleted: { type: 'long', _meta: { description: - 'The number of deleted documents in the index, including hidden nested documents.', + 'The number of deleted lucene documents in the index, including hidden nested documents.', }, }, alias: { @@ -382,6 +382,12 @@ export function getCoreUsageCollector( description: 'The size in bytes of the index, for primaries and replicas.', }, }, + savedObjectsDocsCount: { + type: 'long', + _meta: { + description: 'The number of saved objects documents in the index.', + }, + }, }, }, legacyUrlAliases: { diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 3269452ca8cc3..dcbf919698243 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -6248,13 +6248,13 @@ "docsCount": { "type": "long", "_meta": { - "description": "The number of documents in the index, including hidden nested documents." + "description": "The number of lucene documents in the index, including hidden nested documents." } }, "docsDeleted": { "type": "long", "_meta": { - "description": "The number of deleted documents in the index, including hidden nested documents." + "description": "The number of deleted lucene documents in the index, including hidden nested documents." } }, "alias": { @@ -6274,6 +6274,12 @@ "_meta": { "description": "The size in bytes of the index, for primaries and replicas." } + }, + "savedObjectsDocsCount": { + "type": "long", + "_meta": { + "description": "The number of saved objects documents in the index." + } } } } From 4a63ab9b3bee595a392d1ff536b92a6cad5c5d37 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Thu, 3 Feb 2022 10:09:10 -0500 Subject: [PATCH 17/34] Clean up dev docs (#124271) --- dev_docs/api_welcome.mdx | 2 +- dev_docs/getting_started/add_data.mdx | 14 +++++++++++--- dev_docs/kibana_server_core_components.mdx | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dev_docs/api_welcome.mdx b/dev_docs/api_welcome.mdx index cf88bf7eec0da..1127ecc8603b6 100644 --- a/dev_docs/api_welcome.mdx +++ b/dev_docs/api_welcome.mdx @@ -2,7 +2,7 @@ id: kibDevDocsApiWelcome slug: /kibana-dev-docs/api-meta/welcome title: Welcome -summary: How to use our automatically generated API documentation +description: How to use our automatically generated API documentation date: 2021-02-25 tags: ['kibana','dev', 'contributor', 'api docs'] --- diff --git a/dev_docs/getting_started/add_data.mdx b/dev_docs/getting_started/add_data.mdx index 46822b82fc40d..a94ec511cda5e 100644 --- a/dev_docs/getting_started/add_data.mdx +++ b/dev_docs/getting_started/add_data.mdx @@ -2,14 +2,14 @@ id: kibDevAddData slug: /kibana-dev-docs/getting-started/sample-data title: Add data -summary: Learn how to add data to Kibana +description: Learn how to add data to Kibana date: 2021-08-11 tags: ['kibana', 'onboarding', 'dev', 'architecture', 'tutorials'] --- Building a feature and need an easy way to test it out with some data? Below are three options. -## 1. Add Sample Data from the UI +## Sample data Kibana ships with sample data that you can install at the click of the button. If you are building a feature and need some data to test it out with, sample data is a great option. The only limitation is that this data will not work for Security or Observability solutions (see [#62962](https://github.com/elastic/kibana/issues/62962)). @@ -20,7 +20,7 @@ Kibana ships with sample data that you can install at the click of the button. I ![Sample Data](../assets/sample_data.png) -## CSV Upload +## CSV upload 1. If you don't have any data, navigate to Stack Management > Index Patterns and click the link to the uploader. If you do have data, navigate to the **Machine Learning** application. 2. Click on the **Data Visualizer** tab. @@ -35,3 +35,11 @@ The makelogs script generates sample web server logs. Make sure Elasticsearch is ```sh node scripts/makelogs --auth : ``` + +## Realistic solution data + + + +Security and Observability solution applications only work if data exists in particularly named indices, abiding by our [ECS format](https://www.elastic.co/guide/en/ecs/current/index.html). If you would like to use these applications with realistic data, check out the [oblt_cli tool](https://github.com/elastic/observability-test-environments/blob/master/tools/oblt_cli/README.md). This tool sets you up to connect to a remote Elasticsearch cluster that contains the appropriate data via CCS. + + diff --git a/dev_docs/kibana_server_core_components.mdx b/dev_docs/kibana_server_core_components.mdx index 503d8401d4492..c60e085144fff 100644 --- a/dev_docs/kibana_server_core_components.mdx +++ b/dev_docs/kibana_server_core_components.mdx @@ -2,7 +2,7 @@ id: kibServerAndCoreComponents slug: /kibana-dev-docs/core-intro title: Kibana Server and Core components -summary: An introduction to the Kibana server and core components. +description: An introduction to the Kibana server and core components. date: 2021-02-26 tags: ['kibana','onboarding', 'dev', 'architecture'] --- From 96c4a89074aa920ac860251ecfc783c952b3a8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 3 Feb 2022 16:47:57 +0100 Subject: [PATCH 18/34] [Metrics UI] Allow single values for ip and mac node metadata (#124384) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/infra/common/http_api/metadata_api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/infra/common/http_api/metadata_api.ts b/x-pack/plugins/infra/common/http_api/metadata_api.ts index a0524af805f00..0f847f19f75d3 100644 --- a/x-pack/plugins/infra/common/http_api/metadata_api.ts +++ b/x-pack/plugins/infra/common/http_api/metadata_api.ts @@ -37,8 +37,8 @@ export const InfraMetadataHostRT = rt.partial({ name: rt.string, hostname: rt.string, id: rt.string, - ip: rt.array(rt.string), - mac: rt.array(rt.string), + ip: rt.union([rt.array(rt.string), rt.string]), + mac: rt.union([rt.array(rt.string), rt.string]), os: InfraMetadataOSRT, architecture: rt.string, containerized: rt.boolean, From 52880b6879325e3d5708e764bf0aa57b34e8c723 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 3 Feb 2022 16:48:47 +0100 Subject: [PATCH 19/34] fix tsvb metric contrast (#124509) --- .../vis_types/timeseries/public/application/_variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/vis_types/timeseries/public/application/_variables.scss b/src/plugins/vis_types/timeseries/public/application/_variables.scss index 0107c5569d730..b3334c93a9bbe 100644 --- a/src/plugins/vis_types/timeseries/public/application/_variables.scss +++ b/src/plugins/vis_types/timeseries/public/application/_variables.scss @@ -1,7 +1,7 @@ $tvbLineColor: transparentize($euiColorFullShade, .8); $tvbLineColorReversed: transparentize($euiColorEmptyShade, .6); -$tvbTextColor: transparentize($euiColorFullShade, .6); +$tvbTextColor: transparentize($euiColorFullShade, .4); $tvbTextColorReversed: transparentize($euiColorEmptyShade, .4); $tvbValueColor: transparentize($euiColorFullShade, .3); From 1185a33470207a152ddeb4f162703db6c840ac03 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 3 Feb 2022 17:00:42 +0100 Subject: [PATCH 20/34] [Lens] Do not refresh session on "now" drift on incoming data (#124389) --- .../indexpattern_datasource/to_expression.ts | 30 ++++++++++++++++++- .../context_middleware/index.test.ts | 21 +++++++++++++ .../context_middleware/index.ts | 3 +- x-pack/plugins/lens/readme.md | 2 ++ 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts b/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts index 432c932b85da8..0d8b57a5502ad 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts @@ -29,6 +29,15 @@ import { isColumnFormatted, isColumnOfType } from './operations/definitions/help type OriginalColumn = { id: string } & GenericIndexPatternColumn; +declare global { + interface Window { + /** + * Debug setting to make requests complete slower than normal. data.search.aggs.shardDelay.enabled has to be set via settings for this to work + */ + ELASTIC_LENS_DELAY_SECONDS?: number; + } +} + function getExpressionForLayer( layer: IndexPatternLayer, indexPattern: IndexPattern, @@ -139,8 +148,27 @@ function getExpressionForLayer( } }); + if (window.ELASTIC_LENS_DELAY_SECONDS) { + aggs.push( + buildExpression({ + type: 'expression', + chain: [ + buildExpressionFunction('aggShardDelay', { + id: 'the-delay', + enabled: true, + schema: 'metric', + delay: `${window.ELASTIC_LENS_DELAY_SECONDS}s`, + }).toAst(), + ], + }) + ); + } + const idMap = esAggEntries.reduce((currentIdMap, [colId, column], index) => { - const esAggsId = `col-${index}-${index}`; + const esAggsId = window.ELASTIC_LENS_DELAY_SECONDS + ? `col-${index + (column.isBucketed ? 0 : 1)}-${index}` + : `col-${index}-${index}`; + return { ...currentIdMap, [esAggsId]: { diff --git a/x-pack/plugins/lens/public/state_management/context_middleware/index.test.ts b/x-pack/plugins/lens/public/state_management/context_middleware/index.test.ts index 0c3f53cec3a70..f115cb59e6121 100644 --- a/x-pack/plugins/lens/public/state_management/context_middleware/index.test.ts +++ b/x-pack/plugins/lens/public/state_management/context_middleware/index.test.ts @@ -122,5 +122,26 @@ describe('contextMiddleware', () => { expect(store.dispatch).not.toHaveBeenCalled(); expect(next).toHaveBeenCalledWith(action); }); + + it('does not trigger another update on active data update', () => { + const data = mockDataPlugin(); + (data.nowProvider.get as jest.Mock).mockReturnValue(new Date(Date.now() - 30000)); + (data.query.timefilter.timefilter.getTime as jest.Mock).mockReturnValue({ + from: 'now-2m', + to: 'now', + }); + (data.query.timefilter.timefilter.getBounds as jest.Mock).mockReturnValue({ + min: moment(Date.now() - 100000), + max: moment(Date.now() - 30000), + }); + const { next, invoke, store } = createMiddleware(data); + const action = { + type: 'lens/onActiveDataChange', + payload: {}, + }; + invoke(action); + expect(store.dispatch).not.toHaveBeenCalled(); + expect(next).toHaveBeenCalledWith(action); + }); }); }); diff --git a/x-pack/plugins/lens/public/state_management/context_middleware/index.ts b/x-pack/plugins/lens/public/state_management/context_middleware/index.ts index 55d066f6db55b..25dea5527d061 100644 --- a/x-pack/plugins/lens/public/state_management/context_middleware/index.ts +++ b/x-pack/plugins/lens/public/state_management/context_middleware/index.ts @@ -12,6 +12,7 @@ import { setState, LensDispatch, LensStoreDeps, navigateAway } from '..'; import { LensAppState } from '../types'; import { getResolvedDateRange, containsDynamicMath } from '../../utils'; import { subscribeToExternalContext } from './subscribe_to_external_context'; +import { onActiveDataChange } from '../lens_slice'; export const contextMiddleware = (storeDeps: LensStoreDeps) => (store: MiddlewareAPI) => { const unsubscribeFromExternalContext = subscribeToExternalContext( @@ -20,7 +21,7 @@ export const contextMiddleware = (storeDeps: LensStoreDeps) => (store: Middlewar store.dispatch ); return (next: Dispatch) => (action: PayloadAction>) => { - if (!action.payload?.searchSessionId) { + if (!action.payload?.searchSessionId && !onActiveDataChange.match(action)) { updateTimeRange(storeDeps.lensServices.data, store.dispatch); } if (navigateAway.match(action)) { diff --git a/x-pack/plugins/lens/readme.md b/x-pack/plugins/lens/readme.md index 927c4bbef290c..c85005c09754e 100644 --- a/x-pack/plugins/lens/readme.md +++ b/x-pack/plugins/lens/readme.md @@ -24,6 +24,8 @@ Run all tests from the `x-pack` root directory Lens state is kept in the Redux Store. To enable redux logger, open Chrome Developer Tools and type in the console: `window.ELASTIC_LENS_LOGGER=true`. +To simulate long running searches, set `data.search.aggs.shardDelay.enabled` in your `kibana.dev.yml` to true and set the dealy via console in the browser (e.g. for a 20 seconds delay): `window.ELASTIC_LENS_DELAY_SECONDS=20`. + ## UI Terminology Lens has a lot of UI elements – to make it easier to refer to them in issues or bugs, this is a hopefully complete list: From 1f76d8d30ad3d2f6959db2e76057f21c87b80302 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Thu, 3 Feb 2022 17:02:45 +0100 Subject: [PATCH 21/34] [ML] Transforms: Fix destination ingest pipeline form input placeholder. (#124519) Fix to pass on an empty array for the form elements options to show the placeholder text. --- .../components/step_details/step_details_form.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx index e004a074a2922..75ed5c10f0483 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx @@ -486,18 +486,20 @@ export const StepDetailsForm: FC = React.memo( aria-label={i18n.translate( 'xpack.transform.stepDetailsForm.destinationIngestPipelineAriaLabel', { - defaultMessage: 'Select an ingest pipeline', + defaultMessage: 'Select an ingest pipeline (optional)', } )} placeholder={i18n.translate( 'xpack.transform.stepDetailsForm.destinationIngestPipelineComboBoxPlaceholder', { - defaultMessage: 'Select an ingest pipeline', + defaultMessage: 'Select an ingest pipeline (optional)', } )} singleSelection={{ asPlainText: true }} options={ingestPipelineNames.map((label: string) => ({ label }))} - selectedOptions={[{ label: destinationIngestPipeline }]} + selectedOptions={ + destinationIngestPipeline !== '' ? [{ label: destinationIngestPipeline }] : [] + } onChange={(options) => setDestinationIngestPipeline(options[0]?.label ?? '')} />
From fd041c5fe3d10932f5a1d0f4fa39690eee8d93b7 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Thu, 3 Feb 2022 19:12:57 +0300 Subject: [PATCH 22/34] [Visualize] Coloring tooltips in Heatmap are not properly positioned (#124507) --- .../public/components/heatmap_component.tsx | 115 ++++++++-------- .../public/utils/get_color_picker.tsx | 126 ++++++++++-------- 2 files changed, 133 insertions(+), 108 deletions(-) diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx index 197516ce2db90..bac476045eb95 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx @@ -29,7 +29,10 @@ import type { DatatableColumn } from '../../../../expressions/public'; import { ExpressionValueVisDimension } from '../../../../visualizations/public'; import type { HeatmapRenderProps, FilterEvent, BrushEvent } from '../../common'; import { applyPaletteParams, findMinMaxByColumnId, getSortPredicate } from './helpers'; -import { getColorPicker } from '../utils/get_color_picker'; +import { + LegendColorPickerWrapperContext, + LegendColorPickerWrapper, +} from '../utils/get_color_picker'; import { DEFAULT_PALETTE_NAME, defaultPaletteParams } from '../constants'; import { HeatmapIcon } from './heatmap_icon'; import './index.scss'; @@ -172,10 +175,6 @@ export const HeatmapComponent: FC = memo( [uiState] ); - const legendColorPicker = useMemo( - () => getColorPicker(args.legend.position, setColor, uiState), - [args.legend.position, setColor, uiState] - ); const table = data; const valueAccessor = args.valueAccessor ? getAccessor(args.valueAccessor, table.columns) @@ -484,55 +483,63 @@ export const HeatmapComponent: FC = memo( legendPosition={args.legend.position} /> )} - - - `${xValuesFormatter.convert(v) ?? ''}`} - yAxisLabelFormatter={ - yAxisColumn - ? (v) => `${formatFactory(yAxisColumn.meta.params).convert(v) ?? ''}` - : undefined - } - /> - + + + + `${xValuesFormatter.convert(v) ?? ''}`} + yAxisLabelFormatter={ + yAxisColumn + ? (v) => `${formatFactory(yAxisColumn.meta.params).convert(v) ?? ''}` + : undefined + } + /> + + ); } diff --git a/src/plugins/chart_expressions/expression_heatmap/public/utils/get_color_picker.tsx b/src/plugins/chart_expressions/expression_heatmap/public/utils/get_color_picker.tsx index 2f5297c5fd475..771a633456e13 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/utils/get_color_picker.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/utils/get_color_picker.tsx @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import React, { useCallback } from 'react'; +import React, { createContext, useCallback, useContext } from 'react'; import { LegendColorPicker, Position } from '@elastic/charts'; -import { PopoverAnchorPosition, EuiPopover, EuiOutsideClickDetector } from '@elastic/eui'; +import { PopoverAnchorPosition, EuiWrappingPopover, EuiOutsideClickDetector } from '@elastic/eui'; import type { PersistedState } from '../../../../visualizations/public'; import { ColorPicker } from '../../../../charts/public'; @@ -27,59 +27,77 @@ function getAnchorPosition(legendPosition: Position): PopoverAnchorPosition { } } -export const getColorPicker = - ( - legendPosition: Position, - setColor: (newColor: string | null, seriesKey: string | number) => void, - uiState: PersistedState - ): LegendColorPicker => - ({ anchor, color, onClose, onChange, seriesIdentifiers: [seriesIdentifier] }) => { - const seriesName = seriesIdentifier.key; - const overwriteColors: Record = uiState?.get('vis.colors', {}) ?? {}; - const colorIsOverwritten = seriesName.toString() in overwriteColors; - let keyDownEventOn = false; - const handleChange = (newColor: string | null) => { - if (newColor) { - onChange(newColor); - } - setColor(newColor, seriesName); - // close the popover if no color is applied or the user has clicked a color - if (!newColor || !keyDownEventOn) { - onClose(); - } - }; +export interface LegendColorPickerWrapperContextType { + legendPosition: Position; + setColor: (newColor: string | null, seriesKey: string | number) => void; + uiState: PersistedState; +} - const onKeyDown = (e: React.KeyboardEvent) => { - if (e.keyCode === KEY_CODE_ENTER) { - onClose?.(); - } - keyDownEventOn = true; - }; +export const LegendColorPickerWrapperContext = createContext< + LegendColorPickerWrapperContextType | undefined +>(undefined); - const handleOutsideClick = useCallback(() => { - onClose?.(); - }, [onClose]); +export const LegendColorPickerWrapper: LegendColorPicker = ({ + anchor, + color, + onClose, + onChange, + seriesIdentifiers: [seriesIdentifier], +}) => { + const colorPickerWrappingContext = useContext(LegendColorPickerWrapperContext); + const handleOutsideClick = useCallback(() => { + onClose?.(); + }, [onClose]); + + if (!colorPickerWrappingContext) { + return null; + } + + const { legendPosition, setColor, uiState } = colorPickerWrappingContext; + const seriesName = seriesIdentifier.key; - return ( - - - - - - ); + const overwriteColors: Record = uiState?.get('vis.colors', {}) ?? {}; + const colorIsOverwritten = seriesName.toString() in overwriteColors; + let keyDownEventOn = false; + + const handleChange = (newColor: string | null) => { + if (newColor) { + onChange(newColor); + } + setColor(newColor, seriesName); + // close the popover if no color is applied or the user has clicked a color + if (!newColor || !keyDownEventOn) { + onClose(); + } }; + + const onKeyDown = (e: React.KeyboardEvent) => { + if (e.keyCode === KEY_CODE_ENTER) { + onClose?.(); + } + keyDownEventOn = true; + }; + + return ( + + + + + + ); +}; From 4f6be55f0e6322168d2afd9a7b4ff4d3ea04f230 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 3 Feb 2022 11:53:12 -0500 Subject: [PATCH 23/34] [Fleet] Use a docker registry for fleet integration test (#124405) --- .../docker_registry_helper.ts | 69 +++++++++++++++++++ .../reset_preconfiguration.test.ts | 12 ++-- 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 x-pack/plugins/fleet/server/integration_tests/docker_registry_helper.ts diff --git a/x-pack/plugins/fleet/server/integration_tests/docker_registry_helper.ts b/x-pack/plugins/fleet/server/integration_tests/docker_registry_helper.ts new file mode 100644 index 0000000000000..bb34dc3258d05 --- /dev/null +++ b/x-pack/plugins/fleet/server/integration_tests/docker_registry_helper.ts @@ -0,0 +1,69 @@ +/* + * 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 { spawn } from 'child_process'; +import type { ChildProcess } from 'child_process'; + +import fetch from 'node-fetch'; + +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +export function useDockerRegistry() { + const packageRegistryPort = process.env.FLEET_PACKAGE_REGISTRY_PORT || '8081'; + + if (!packageRegistryPort.match(/^[0-9]{4}/)) { + throw new Error('Invalid FLEET_PACKAGE_REGISTRY_PORT'); + } + + let dockerProcess: ChildProcess | undefined; + async function startDockerRegistryServer() { + const dockerImage = `docker.elastic.co/package-registry/distribution@sha256:de952debe048d903fc73e8a4472bb48bb95028d440cba852f21b863d47020c61`; + + const args = ['run', '--rm', '-p', `${packageRegistryPort}:8080`, dockerImage]; + + dockerProcess = spawn('docker', args, { stdio: 'inherit' }); + + let isExited = dockerProcess.exitCode !== null; + dockerProcess.once('exit', () => { + isExited = true; + }); + + let retries = 0; + while (!isExited && retries++ <= 20) { + try { + const res = await fetch(`http://localhost:${packageRegistryPort}/`); + if (res.status === 200) { + return; + } + } catch (err) { + // swallow errors + } + + await delay(3000); + } + + dockerProcess.kill(); + throw new Error('Unable to setup docker registry'); + } + + async function cleanupDockerRegistryServer() { + if (dockerProcess && !dockerProcess.killed) { + dockerProcess.kill(); + } + } + + beforeAll(async () => { + jest.setTimeout(5 * 60 * 1000); // 5 minutes timeout + await startDockerRegistryServer(); + }); + + afterAll(async () => { + await cleanupDockerRegistryServer(); + }); + + return `http://localhost:${packageRegistryPort}`; +} diff --git a/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts b/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts index 9efbacfae17bf..4a2b4f2495e96 100644 --- a/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts @@ -14,6 +14,8 @@ import type { HttpMethod } from 'src/core/test_helpers/kbn_server'; import type { AgentPolicySOAttributes } from '../types'; +import { useDockerRegistry } from './docker_registry_helper'; + const logFilePath = Path.join(__dirname, 'logs.log'); type Root = ReturnType; @@ -46,6 +48,8 @@ describe('Fleet preconfiguration reset', () => { let esServer: kbnTestServer.TestElasticsearchUtils; let kbnServer: kbnTestServer.TestKibanaUtils; + const registryUrl = useDockerRegistry(); + const startServers = async () => { const { startES } = kbnTestServer.createTestServers({ adjustTimeout: (t) => jest.setTimeout(t), @@ -63,6 +67,7 @@ describe('Fleet preconfiguration reset', () => { { xpack: { fleet: { + registryUrl, packages: [ { name: 'fleet_server', @@ -195,8 +200,7 @@ describe('Fleet preconfiguration reset', () => { await stopServers(); }); - // FLAKY: https://github.com/elastic/kibana/issues/123103 - describe.skip('Reset all policy', () => { + describe('Reset all policy', () => { it('Works and reset all preconfigured policies', async () => { const resetAPI = getSupertestWithAdminUser( kbnServer.root, @@ -225,9 +229,7 @@ describe('Fleet preconfiguration reset', () => { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/123104 - // FLAKY: https://github.com/elastic/kibana/issues/123105 - describe.skip('Reset one preconfigured policy', () => { + describe('Reset one preconfigured policy', () => { const POLICY_ID = 'test-12345'; it('Works and reset one preconfigured policies if the policy is already deleted (with a ghost package policy)', async () => { From 21710dfb773e892b9ab0ed1e81a576c536a824bb Mon Sep 17 00:00:00 2001 From: Sergi Massaneda Date: Thu, 3 Feb 2022 18:03:25 +0100 Subject: [PATCH 24/34] [SecuritySolution] Close field editor when page context is lost (#124378) * close field editor when context is lost * tests added * typecheck clean * close editor when timeline is unmounted --- .../components/events_viewer/index.test.tsx | 23 +++ .../common/components/events_viewer/index.tsx | 15 +- .../create_field_button/index.test.tsx | 38 +++- .../components/create_field_button/index.tsx | 25 ++- .../__snapshots__/index.test.tsx.snap | 1 + .../body/column_headers/index.test.tsx | 183 ++++++++---------- .../timeline/body/column_headers/index.tsx | 30 ++- .../components/timeline/body/index.test.tsx | 1 + .../components/timeline/body/index.tsx | 7 +- 9 files changed, 208 insertions(+), 115 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx index 9dd8bf59893c0..2ecae44487908 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx @@ -33,6 +33,11 @@ jest.mock('../../../timelines/containers', () => ({ jest.mock('../../components/url_state/normalize_time_range.ts'); +const mockUseCreateFieldButton = jest.fn().mockReturnValue(<>); +jest.mock('../../../timelines/components/create_field_button', () => ({ + useCreateFieldButton: (...params: unknown[]) => mockUseCreateFieldButton(...params), +})); + const mockUseResizeObserver: jest.Mock = useResizeObserver as jest.Mock; jest.mock('use-resize-observer/polyfilled'); mockUseResizeObserver.mockImplementation(() => ({})); @@ -87,4 +92,22 @@ describe('StatefulEventsViewer', () => { expect(wrapper.find(`InspectButtonContainer`).exists()).toBe(true); }); }); + + test('it closes field editor when unmounted', async () => { + const mockCloseEditor = jest.fn(); + mockUseCreateFieldButton.mockImplementation((_, __, fieldEditorActionsRef) => { + fieldEditorActionsRef.current = { closeEditor: mockCloseEditor }; + return <>; + }); + + const wrapper = mount( + + + + ); + expect(mockCloseEditor).not.toHaveBeenCalled(); + + wrapper.unmount(); + expect(mockCloseEditor).toHaveBeenCalled(); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx index 97b0424168f0a..9fa91ed25c995 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useCallback, useMemo, useEffect } from 'react'; +import React, { useRef, useCallback, useMemo, useEffect } from 'react'; import { connect, ConnectedProps, useDispatch } from 'react-redux'; import deepEqual from 'fast-deep-equal'; import styled from 'styled-components'; @@ -29,7 +29,10 @@ import { CellValueElementProps } from '../../../timelines/components/timeline/ce import { FIELDS_WITHOUT_CELL_ACTIONS } from '../../lib/cell_actions/constants'; import { useKibana } from '../../lib/kibana'; import { GraphOverlay } from '../../../timelines/components/graph_overlay'; -import { useCreateFieldButton } from '../../../timelines/components/create_field_button'; +import { + CreateFieldEditorActions, + useCreateFieldButton, +} from '../../../timelines/components/create_field_button'; const EMPTY_CONTROL_COLUMNS: ControlColumnProps[] = []; @@ -121,6 +124,8 @@ const StatefulEventsViewerComponent: React.FC = ({ const tGridEventRenderedViewEnabled = useIsExperimentalFeatureEnabled( 'tGridEventRenderedViewEnabled' ); + const editorActionsRef = useRef(null); + useEffect(() => { if (createTimeline != null) { createTimeline({ @@ -137,6 +142,10 @@ const StatefulEventsViewerComponent: React.FC = ({ } return () => { deleteEventQuery({ id, inputId: 'global' }); + if (editorActionsRef.current) { + // eslint-disable-next-line react-hooks/exhaustive-deps + editorActionsRef.current.closeEditor(); + } }; // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -167,7 +176,7 @@ const StatefulEventsViewerComponent: React.FC = ({ }, [id, timelineQuery, globalQuery]); const bulkActions = useMemo(() => ({ onAlertStatusActionSuccess }), [onAlertStatusActionSuccess]); - const createFieldComponent = useCreateFieldButton(scopeId, id); + const createFieldComponent = useCreateFieldButton(scopeId, id, editorActionsRef); return ( <> diff --git a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx index 6f3f3e8b87bc8..0afb2bf641351 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx @@ -6,8 +6,8 @@ */ import { render, fireEvent, act, screen } from '@testing-library/react'; -import React from 'react'; -import { CreateFieldButton } from './index'; +import React, { MutableRefObject } from 'react'; +import { CreateFieldButton, CreateFieldEditorActions } from './index'; import { indexPatternFieldEditorPluginMock, Start, @@ -108,4 +108,38 @@ describe('CreateFieldButton', () => { fireEvent.click(screen.getByRole('button')); expect(onClickParam).toHaveBeenCalled(); }); + + it("stores 'closeEditor' in the actions ref when editor is open", async () => { + const mockCloseEditor = jest.fn(); + useKibanaMock().services.data.dataViews.get = () => Promise.resolve({} as DataView); + useKibanaMock().services.dataViewFieldEditor.openEditor = () => mockCloseEditor; + + const editorActionsRef: MutableRefObject = React.createRef(); + await act(async () => { + render( + undefined} + timelineId={TimelineId.detectionsPage} + editorActionsRef={editorActionsRef} + />, + { + wrapper: TestProviders, + } + ); + await runAllPromises(); + }); + + expect(editorActionsRef?.current).toBeNull(); + + fireEvent.click(screen.getByRole('button')); + + expect(mockCloseEditor).not.toHaveBeenCalled(); + expect(editorActionsRef?.current?.closeEditor).toBeDefined(); + + editorActionsRef!.current!.closeEditor(); + + expect(mockCloseEditor).toHaveBeenCalled(); + expect(editorActionsRef!.current).toBeNull(); + }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx index 04f23605efac5..8979a78d7aa46 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import React, { MutableRefObject, useCallback, useEffect, useMemo, useState } from 'react'; import { EuiButton } from '@elastic/eui'; import styled from 'styled-components'; @@ -23,17 +23,21 @@ import { useDeepEqualSelector } from '../../../common/hooks/use_selector'; import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/constants'; import { defaultColumnHeaderType } from '../timeline/body/column_headers/default_headers'; +export type CreateFieldEditorActions = { closeEditor: () => void } | null; +type CreateFieldEditorActionsRef = MutableRefObject; + interface CreateFieldButtonProps { selectedDataViewId: string; onClick: () => void; timelineId: TimelineId; + editorActionsRef?: CreateFieldEditorActionsRef; } const StyledButton = styled(EuiButton)` margin-left: ${({ theme }) => theme.eui.paddingSizes.m}; `; export const CreateFieldButton = React.memo( - ({ selectedDataViewId, onClick: onClickParam, timelineId }) => { + ({ selectedDataViewId, onClick: onClickParam, timelineId, editorActionsRef }) => { const [dataView, setDataView] = useState(null); const dispatch = useDispatch(); @@ -52,7 +56,7 @@ export const CreateFieldButton = React.memo( const onClick = useCallback(() => { if (dataView) { - dataViewFieldEditor?.openEditor({ + const closeFieldEditor = dataViewFieldEditor?.openEditor({ ctx: { dataView }, onSave: async (field: DataViewField) => { // Fetch the updated list of fields @@ -72,6 +76,14 @@ export const CreateFieldButton = React.memo( ); }, }); + if (editorActionsRef) { + editorActionsRef.current = { + closeEditor: () => { + editorActionsRef.current = null; + closeFieldEditor(); + }, + }; + } } onClickParam(); }, [ @@ -82,6 +94,7 @@ export const CreateFieldButton = React.memo( selectedDataViewId, dispatch, timelineId, + editorActionsRef, ]); if ( @@ -116,7 +129,8 @@ CreateFieldButton.displayName = 'CreateFieldButton'; */ export const useCreateFieldButton = ( sourcererScope: SourcererScopeName, - timelineId: TimelineId + timelineId: TimelineId, + editorActionsRef?: CreateFieldEditorActionsRef ) => { const scopeIdSelector = useMemo(() => sourcererSelectors.scopeIdSelector(), []); const { missingPatterns, selectedDataViewId } = useDeepEqualSelector((state) => @@ -133,9 +147,10 @@ export const useCreateFieldButton = ( selectedDataViewId={selectedDataViewId} onClick={onClick} timelineId={timelineId} + editorActionsRef={editorActionsRef} /> ); return CreateFieldButtonComponent; - }, [missingPatterns.length, selectedDataViewId, timelineId]); + }, [missingPatterns.length, selectedDataViewId, timelineId, editorActionsRef]); }; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/__snapshots__/index.test.tsx.snap index 644a3c95baf08..2d625f678721b 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/__snapshots__/index.test.tsx.snap @@ -658,6 +658,7 @@ exports[`ColumnHeaders rendering renders correctly against snapshot 1`] = ` ] } onSelectAll={[Function]} + show={true} showEventsSelect={false} showSelectAllCheckbox={false} sort={ diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.test.tsx index 59bdcf808ca42..aec28732f38af 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.test.tsx @@ -16,7 +16,7 @@ import { Sort } from '../sort'; import { TestProviders } from '../../../../../common/mock/test_providers'; import { useMountAppended } from '../../../../../common/utils/use_mount_appended'; -import { ColumnHeadersComponent } from '.'; +import { ColumnHeadersComponent, ColumnHeadersComponentProps } from '.'; import { cloneDeep } from 'lodash/fp'; import { timelineActions } from '../../../../store/timeline'; import { TimelineTabs } from '../../../../../../common/types/timeline'; @@ -27,6 +27,11 @@ import { HeaderActions } from '../actions/header_actions'; jest.mock('../../../../../common/lib/kibana'); +const mockUseCreateFieldButton = jest.fn().mockReturnValue(<>); +jest.mock('../../../create_field_button', () => ({ + useCreateFieldButton: (...params: unknown[]) => mockUseCreateFieldButton(...params), +})); + const mockDispatch = jest.fn(); jest.mock('react-redux', () => { const original = jest.requireActual('react-redux'); @@ -46,33 +51,34 @@ describe('ColumnHeaders', () => { ...x, headerCellRender: HeaderActions, })); + const sort: Sort[] = [ + { + columnId: '@timestamp', + columnType: 'number', + sortDirection: Direction.desc, + }, + ]; + const defaultProps: ColumnHeadersComponentProps = { + actionsColumnWidth, + browserFields: mockBrowserFields, + columnHeaders: defaultHeaders, + isSelectAllChecked: false, + onSelectAll: jest.fn, + show: true, + showEventsSelect: false, + showSelectAllCheckbox: false, + sort, + tabType: TimelineTabs.query, + timelineId, + leadingControlColumns, + trailingControlColumns: [], + }; describe('rendering', () => { - const sort: Sort[] = [ - { - columnId: '@timestamp', - columnType: 'number', - sortDirection: Direction.desc, - }, - ]; - test('renders correctly against snapshot', () => { const wrapper = shallow( - + ); expect(wrapper.find('ColumnHeadersComponent')).toMatchSnapshot(); @@ -81,20 +87,7 @@ describe('ColumnHeaders', () => { test('it renders the field browser', () => { const wrapper = mount( - + ); @@ -104,20 +97,7 @@ describe('ColumnHeaders', () => { test('it renders every column header', () => { const wrapper = mount( - + ); @@ -166,18 +146,7 @@ describe('ColumnHeaders', () => { const wrapper = mount( ); @@ -210,18 +179,7 @@ describe('ColumnHeaders', () => { const wrapper = mount( ); @@ -249,18 +207,11 @@ describe('ColumnHeaders', () => { const wrapper = mount( ); @@ -287,18 +238,13 @@ describe('ColumnHeaders', () => { const wrapper = mount( ); @@ -307,4 +253,43 @@ describe('ColumnHeaders', () => { expect(wrapper.exists('[data-test-subj="test-header-action-cell"]')).toBeTruthy(); }); }); + + describe('Field Editor', () => { + test('Closes field editor when the timeline is unmounted', () => { + const mockCloseEditor = jest.fn(); + mockUseCreateFieldButton.mockImplementation((_, __, fieldEditorActionsRef) => { + fieldEditorActionsRef.current = { closeEditor: mockCloseEditor }; + return <>; + }); + + const wrapper = mount( + + + + ); + expect(mockCloseEditor).not.toHaveBeenCalled(); + + wrapper.unmount(); + expect(mockCloseEditor).toHaveBeenCalled(); + }); + + test('Closes field editor when the timeline is closed', () => { + const mockCloseEditor = jest.fn(); + mockUseCreateFieldButton.mockImplementation((_, __, fieldEditorActionsRef) => { + fieldEditorActionsRef.current = { closeEditor: mockCloseEditor }; + return <>; + }); + + const Proxy = (props: ColumnHeadersComponentProps) => ( + + + + ); + const wrapper = mount(); + expect(mockCloseEditor).not.toHaveBeenCalled(); + + wrapper.setProps({ ...defaultProps, show: false }); + expect(mockCloseEditor).toHaveBeenCalled(); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx index 80a9022105d2c..ca1cdef903de8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ import deepEqual from 'fast-deep-equal'; -import React, { useState, useEffect, useCallback, useMemo } from 'react'; +import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react'; import { Droppable, DraggableChildrenFn } from 'react-beautiful-dnd'; import { DragEffects } from '../../../../../common/components/drag_and_drop/draggable_wrapper'; @@ -34,15 +34,16 @@ import { Sort } from '../sort'; import { ColumnHeader } from './column_header'; import { SourcererScopeName } from '../../../../../common/store/sourcerer/model'; -import { useCreateFieldButton } from '../../../create_field_button'; +import { CreateFieldEditorActions, useCreateFieldButton } from '../../../create_field_button'; -interface Props { +export interface ColumnHeadersComponentProps { actionsColumnWidth: number; browserFields: BrowserFields; columnHeaders: ColumnHeaderOptions[]; isEventViewer?: boolean; isSelectAllChecked: boolean; onSelectAll: OnSelectAll; + show: boolean; showEventsSelect: boolean; showSelectAllCheckbox: boolean; sort: Sort[]; @@ -92,6 +93,7 @@ export const ColumnHeadersComponent = ({ isEventViewer = false, isSelectAllChecked, onSelectAll, + show, showEventsSelect, showSelectAllCheckbox, sort, @@ -99,8 +101,24 @@ export const ColumnHeadersComponent = ({ timelineId, leadingControlColumns, trailingControlColumns, -}: Props) => { +}: ColumnHeadersComponentProps) => { const [draggingIndex, setDraggingIndex] = useState(null); + const fieldEditorActionsRef = useRef(null); + + useEffect(() => { + return () => { + if (fieldEditorActionsRef.current) { + // eslint-disable-next-line react-hooks/exhaustive-deps + fieldEditorActionsRef.current.closeEditor(); + } + }; + }, []); + + useEffect(() => { + if (!show && fieldEditorActionsRef.current) { + fieldEditorActionsRef.current.closeEditor(); + } + }, [show]); const renderClone: DraggableChildrenFn = useCallback( (dragProvided, _dragSnapshot, rubric) => { @@ -174,7 +192,8 @@ export const ColumnHeadersComponent = ({ const createFieldComponent = useCreateFieldButton( SourcererScopeName.timeline, - timelineId as TimelineId + timelineId as TimelineId, + fieldEditorActionsRef ); const LeadingHeaderActions = useMemo(() => { @@ -300,6 +319,7 @@ export const ColumnHeaders = React.memo( prevProps.isEventViewer === nextProps.isEventViewer && prevProps.isSelectAllChecked === nextProps.isSelectAllChecked && prevProps.onSelectAll === nextProps.onSelectAll && + prevProps.show === nextProps.show && prevProps.showEventsSelect === nextProps.showEventsSelect && prevProps.showSelectAllCheckbox === nextProps.showSelectAllCheckbox && deepEqual(prevProps.sort, nextProps.sort) && diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx index 5467dbab9845c..db927e67ccc67 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx @@ -146,6 +146,7 @@ describe('Body', () => { selectedEventIds: {}, setSelected: jest.fn() as unknown as StatefulBodyProps['setSelected'], sort: mockSort, + show: true, showCheckboxes: false, tabType: TimelineTabs.query, totalPages: 1, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.tsx index 7e7192610a222..7257d4246f6fe 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.tsx @@ -89,6 +89,7 @@ export const BodyComponent = React.memo( setSelected, clearSelected, onRuleChange, + show, showCheckboxes, refetch, renderCellValue, @@ -244,6 +245,7 @@ export const BodyComponent = React.memo( isEventViewer={isEventViewer} isSelectAllChecked={isSelectAllChecked} onSelectAll={onSelectAll} + show={show} showEventsSelect={false} showSelectAllCheckbox={showCheckboxes} sort={sort} @@ -298,7 +300,8 @@ export const BodyComponent = React.memo( prevProps.renderCellValue === nextProps.renderCellValue && prevProps.rowRenderers === nextProps.rowRenderers && prevProps.showCheckboxes === nextProps.showCheckboxes && - prevProps.tabType === nextProps.tabType + prevProps.tabType === nextProps.tabType && + prevProps.show === nextProps.show ); BodyComponent.displayName = 'BodyComponent'; @@ -321,6 +324,7 @@ const makeMapStateToProps = () => { pinnedEventIds, selectedEventIds, showCheckboxes, + show, } = timeline; return { @@ -333,6 +337,7 @@ const makeMapStateToProps = () => { pinnedEventIds, selectedEventIds, showCheckboxes, + show, }; }; return mapStateToProps; From d091e17d16a7c8a56bee9987872ad4c725e07ef5 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Thu, 3 Feb 2022 18:13:20 +0100 Subject: [PATCH 25/34] [Uptime] Fix uptime telemetry expensive query calls (#124281) --- .../plugins/uptime/public/state/api/utils.ts | 2 ++ .../telemetry/kibana_telemetry_adapter.ts | 19 +++++++++++++++---- .../server/lib/adapters/telemetry/types.ts | 1 + .../rest_api/telemetry/log_page_view.ts | 15 +++++++++++---- .../apis/uptime/rest/telemetry_collectors.ts | 18 +++++++++++++----- .../uptime/rest/telemetry_collectors_fleet.ts | 1 + 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/uptime/public/state/api/utils.ts b/x-pack/plugins/uptime/public/state/api/utils.ts index 8dcef2239ca22..c0b403d8884e8 100644 --- a/x-pack/plugins/uptime/public/state/api/utils.ts +++ b/x-pack/plugins/uptime/public/state/api/utils.ts @@ -109,6 +109,8 @@ class ApiService { body: JSON.stringify(data), }); + this.addInspectorRequest?.({ data: response, status: FETCH_STATUS.SUCCESS, loading: false }); + if (decodeType) { const decoded = decodeType.decode(response); if (isRight(decoded)) { diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts index f72af3311affe..de09c686d4441 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts @@ -11,6 +11,7 @@ import { CollectorFetchContext, UsageCollectionSetup } from 'src/plugins/usage_c import { PageViewParams, UptimeTelemetry, Usage } from './types'; import { savedObjectsAdapter } from '../../saved_objects/saved_objects'; import { UptimeESClient, createUptimeESClient } from '../../lib'; +import { createEsQuery } from '../../../../common/utils/es_search'; interface UptimeTelemetryCollector { [key: number]: UptimeTelemetry; @@ -215,7 +216,7 @@ export class KibanaTelemetryAdapter { savedObjectsClient: SavedObjectsClientContract ) { const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings(savedObjectsClient); - const params = { + const params = createEsQuery({ index: dynamicSettings.heartbeatIndices, body: { query: { @@ -229,6 +230,11 @@ export class KibanaTelemetryAdapter { }, }, }, + { + exists: { + field: 'summary', + }, + }, ], }, }, @@ -271,9 +277,9 @@ export class KibanaTelemetryAdapter { }, }, }, - }; + }); - const { body: result } = await callCluster.search(params); + const { body: result } = await callCluster.search(params, 'telemetryLog'); const numberOfUniqueMonitors: number = result?.aggregations?.unique_monitors?.value ?? 0; const numberOfUniqueLocations: number = result?.aggregations?.unique_locations?.value ?? 0; @@ -318,6 +324,11 @@ export class KibanaTelemetryAdapter { }, }, }, + { + exists: { + field: 'summary', + }, + }, { term: { 'monitor.fleet_managed': true, @@ -356,7 +367,7 @@ export class KibanaTelemetryAdapter { }, }; - const { body: result } = await callCluster.search(params); + const { body: result } = await callCluster.search(params, 'telemetryLogFleet'); const numberOfUniqueMonitors: number = result?.aggregations?.unique_monitors?.value ?? 0; const monitorNameStats = result?.aggregations?.monitor_name; diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts index eceee3505dd7e..7095ae8e38ab5 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/types.ts @@ -12,6 +12,7 @@ export interface PageViewParams { autoRefreshEnabled: boolean; autorefreshInterval: number; refreshTelemetryHistory?: boolean; + refreshEsData?: boolean; } export interface Stats { diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts index ec7de05dd2cf1..eb3447d85424b 100644 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts +++ b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts @@ -21,18 +21,25 @@ export const createLogPageViewRoute: UMRestApiRouteFactory = () => ({ dateEnd: schema.string(), autoRefreshEnabled: schema.boolean(), autorefreshInterval: schema.number(), + refreshEsData: schema.maybe(schema.boolean()), refreshTelemetryHistory: schema.maybe(schema.boolean()), }), }, handler: async ({ savedObjectsClient, uptimeEsClient, request }): Promise => { const pageView = request.body as PageViewParams; if (pageView.refreshTelemetryHistory) { + // this is primarily only used for API testing KibanaTelemetryAdapter.clearLocalTelemetry(); } - await KibanaTelemetryAdapter.countNoOfUniqueMonitorAndLocations( - uptimeEsClient, - savedObjectsClient - ); + + if (pageView.refreshEsData) { + // this is primarily only used for API testing + + await KibanaTelemetryAdapter.countNoOfUniqueMonitorAndLocations( + uptimeEsClient, + savedObjectsClient + ); + } await KibanaTelemetryAdapter.countNoOfUniqueFleetManagedMonitors(uptimeEsClient); return KibanaTelemetryAdapter.countPageView(pageView as PageViewParams); }, diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts index de65fe6deb985..e9aa339f62e14 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts @@ -14,8 +14,7 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const es = getService('es'); - // FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/111240 - describe.skip('telemetry collectors heartbeat', () => { + describe('telemetry collectors heartbeat', () => { before('generating data', async () => { await getService('esArchiver').load('x-pack/test/functional/es_archives/uptime/blank'); @@ -69,7 +68,7 @@ export default function ({ getService }: FtrProviderContext) { 'downMonitorId', 1, 1, - 1, + 10 * 1000, { observer, monitor: { @@ -79,7 +78,15 @@ export default function ({ getService }: FtrProviderContext) { 'down' ); - await makeChecksWithStatus(es, 'mixMonitorId', 1, 1, 1, { observer: observer2 }, 'down'); + await makeChecksWithStatus( + es, + 'mixMonitorId', + 1, + 1, + 30 * 1000, + { observer: observer2 }, + 'down' + ); await es.indices.refresh(); }); @@ -103,6 +110,7 @@ export default function ({ getService }: FtrProviderContext) { dateEnd: 'now/d', autoRefreshEnabled: true, refreshTelemetryHistory: true, + refreshEsData: true, }) .expect(200); @@ -111,7 +119,7 @@ export default function ({ getService }: FtrProviderContext) { monitor_page: 1, no_of_unique_monitors: 4, settings_page: 0, - monitor_frequency: [120, 0.001, 60, 60], + monitor_frequency: [10, 30, 60, 60], monitor_name_stats: { min_length: 7, max_length: 22, avg_length: 12 }, no_of_unique_observer_locations: 3, observer_location_name_stats: { min_length: 2, max_length: 7, avg_length: 4.8 }, diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts index daf70c3fbb724..84d6d71a4ab6d 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts @@ -175,6 +175,7 @@ export default function ({ getService }: FtrProviderContext) { dateEnd: 'now/d', autoRefreshEnabled: true, refreshTelemetryHistory: true, + refreshEsData: true, }) .expect(200); From 941d31c4c7b082db859c422afc2b7356f4196207 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Thu, 3 Feb 2022 10:14:06 -0700 Subject: [PATCH 26/34] [Reporting] Fix incorrect event log value for byteSize (#124458) * [Reporting] Fix incorrect event log value for byteSize * add event log test --- .../server/lib/tasks/execute_report.ts | 4 +- .../__snapshots__/event_log.snap | 11 +++ .../reporting_and_security/event_log.ts | 87 +++++++++++++++++++ .../reporting_and_security/index.ts | 1 + 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/event_log.snap create mode 100644 x-pack/test/reporting_api_integration/reporting_and_security/event_log.ts diff --git a/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts b/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts index dd3f93ad2c0c6..dbd11943f70e4 100644 --- a/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts +++ b/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts @@ -358,13 +358,13 @@ export class ExecuteReportTask implements ReportingTask { stream.end(); - eventLog.logExecutionComplete({ byteSize: stream.bytesWritten }); - await promisify(finished)(stream, { readable: false }); report._seq_no = stream.getSeqNo()!; report._primary_term = stream.getPrimaryTerm()!; + eventLog.logExecutionComplete({ byteSize: stream.bytesWritten }); + if (output) { this.logger.debug(`Job output size: ${stream.bytesWritten} bytes.`); report = await this._completeJob(report, { diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/event_log.snap b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/event_log.snap new file mode 100644 index 0000000000000..603ab78db8c13 --- /dev/null +++ b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/event_log.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Reporting APIs Report generation event logging creates a completed action for a PDF report 1`] = ` +"\\"_id\\",\\"_index\\",\\"_score\\",category,\\"category.keyword\\",currency,\\"customer_first_name\\",\\"customer_first_name.keyword\\",\\"customer_full_name\\",\\"customer_full_name.keyword\\",\\"customer_gender\\",\\"customer_id\\",\\"customer_last_name\\",\\"customer_last_name.keyword\\",\\"customer_phone\\",\\"day_of_week\\",\\"day_of_week_i\\",email,\\"geoip.city_name\\",\\"geoip.continent_name\\",\\"geoip.country_iso_code\\",\\"geoip.location\\",\\"geoip.region_name\\",manufacturer,\\"manufacturer.keyword\\",\\"order_date\\",\\"order_id\\",\\"products._id\\",\\"products._id.keyword\\",\\"products.base_price\\",\\"products.base_unit_price\\",\\"products.category\\",\\"products.category.keyword\\",\\"products.created_on\\",\\"products.discount_amount\\",\\"products.discount_percentage\\",\\"products.manufacturer\\",\\"products.manufacturer.keyword\\",\\"products.min_price\\",\\"products.price\\",\\"products.product_id\\",\\"products.product_name\\",\\"products.product_name.keyword\\",\\"products.quantity\\",\\"products.sku\\",\\"products.tax_amount\\",\\"products.taxful_price\\",\\"products.taxless_price\\",\\"products.unit_discount_amount\\",sku,\\"taxful_total_price\\",\\"taxless_total_price\\",\\"total_quantity\\",\\"total_unique_products\\",type,user +zQMtOW0BH63Xcmy432DJ,ecommerce,1,\\"Men's Clothing\\",\\"Men's Clothing\\",EUR,Eddie,Eddie,\\"Eddie Underwood\\",\\"Eddie Underwood\\",MALE,38,Underwood,Underwood,\\"(empty)\\",Monday,0,\\"eddie@underwood-family.zzz\\",Cairo,Africa,EG,\\"POINT (31.3 30.1)\\",\\"Cairo Governorate\\",\\"Elitelligence, Oceanavigations\\",\\"Elitelligence, Oceanavigations\\",\\"Jul 7, 2019 @ 00:00:00.000\\",584677,\\"sold_product_584677_6283, sold_product_584677_19400\\",\\"sold_product_584677_6283, sold_product_584677_19400\\",\\"11.992, 24.984\\",\\"11.992, 24.984\\",\\"Men's Clothing, Men's Clothing\\",\\"Men's Clothing, Men's Clothing\\",\\"Dec 26, 2016 @ 00:00:00.000, Dec 26, 2016 @ 00:00:00.000\\",\\"0, 0\\",\\"0, 0\\",\\"Elitelligence, Oceanavigations\\",\\"Elitelligence, Oceanavigations\\",\\"6.352, 11.75\\",\\"11.992, 24.984\\",\\"6,283, 19,400\\",\\"Basic T-shirt - dark blue/white, Sweatshirt - grey multicolor\\",\\"Basic T-shirt - dark blue/white, Sweatshirt - grey multicolor\\",\\"1, 1\\",\\"ZO0549605496, ZO0299602996\\",\\"0, 0\\",\\"11.992, 24.984\\",\\"11.992, 24.984\\",\\"0, 0\\",\\"ZO0549605496, ZO0299602996\\",\\"36.969\\",\\"36.969\\",2,2,order,eddie +zgMtOW0BH63Xcmy432DJ,ecommerce,1,\\"Women's Clothing\\",\\"Women's Clothing\\",EUR,Mary,Mary,\\"Mary Bailey\\",\\"Mary Bailey\\",FEMALE,20,Bailey,Bailey,\\"(empty)\\",Sunday,6,\\"mary@bailey-family.zzz\\",Dubai,Asia,AE,\\"POINT (55.3 25.3)\\",Dubai,\\"Champion Arts, Pyramidustries\\",\\"Champion Arts, Pyramidustries\\",\\"Jul 6, 2019 @ 00:00:00.000\\",584021,\\"sold_product_584021_11238, sold_product_584021_20149\\",\\"sold_product_584021_11238, sold_product_584021_20149\\",\\"24.984, 28.984\\",\\"24.984, 28.984\\",\\"Women's Clothing, Women's Clothing\\",\\"Women's Clothing, Women's Clothing\\",\\"Dec 25, 2016 @ 00:00:00.000, Dec 25, 2016 @ 00:00:00.000\\",\\"0, 0\\",\\"0, 0\\",\\"Champion Arts, Pyramidustries\\",\\"Champion Arts, Pyramidustries\\",\\"11.75, 15.648\\",\\"24.984, 28.984\\",\\"11,238, 20,149\\",\\"Denim dress - black denim, Shorts - black\\",\\"Denim dress - black denim, Shorts - black\\",\\"1, 1\\",\\"ZO0489604896, ZO0185501855\\",\\"0, 0\\",\\"24.984, 28.984\\",\\"24.984, 28.984\\",\\"0, 0\\",\\"ZO0489604896, ZO0185501855\\",\\"53.969\\",\\"53.969\\",2,2,order,mary +zwMtOW0BH63Xcmy432DJ,ecommerce,1,\\"Women's Shoes, Women's Clothing\\",\\"Women's Shoes, Women's Clothing\\",EUR,Gwen,Gwen,\\"Gwen Butler\\",\\"Gwen Butler\\",FEMALE,26,Butler,Butler,\\"(empty)\\",Sunday,6,\\"gwen@butler-family.zzz\\",\\"Los Angeles\\",\\"North America\\",US,\\"POINT (-118.2 34.1)\\",California,\\"Low Tide Media, Oceanavigations\\",\\"Low Tide Media, Oceanavigations\\",\\"Jul 6, 2019 @ 00:00:00.000\\",584058,\\"sold_product_584058_22794, sold_product_584058_23386\\",\\"sold_product_584058_22794, sold_product_584058_23386\\",\\"100, 100\\",\\"100, 100\\",\\"Women's Shoes, Women's Clothing\\",\\"Women's Shoes, Women's Clothing\\",\\"Dec 25, 2016 @ 00:00:00.000, Dec 25, 2016 @ 00:00:00.000\\",\\"0, 0\\",\\"0, 0\\",\\"Low Tide Media, Oceanavigations\\",\\"Low Tide Media, Oceanavigations\\",\\"46, 54\\",\\"100, 100\\",\\"22,794, 23,386\\",\\"Boots - Midnight Blue, Short coat - white/black\\",\\"Boots - Midnight Blue, Short coat - white/black\\",\\"1, 1\\",\\"ZO0374603746, ZO0272202722\\",\\"0, 0\\",\\"100, 100\\",\\"100, 100\\",\\"0, 0\\",\\"ZO0374603746, ZO0272202722\\",200,200,2,2,order,gwen +0AMtOW0BH63Xcmy432DJ,ecommerce,1,\\"Women's Shoes, Women's Clothing\\",\\"Women's Shoes, Women's Clothing\\",EUR,Diane,Diane,\\"Diane Chandler\\",\\"Diane Chandler\\",FEMALE,22,Chandler,Chandler,\\"(empty)\\",Sunday,6,\\"diane@chandler-family.zzz\\",\\"-\\",Europe,GB,\\"POINT (-0.1 51.5)\\",\\"-\\",\\"Primemaster, Oceanavigations\\",\\"Primemaster, Oceanavigations\\",\\"Jul 6, 2019 @ 00:00:00.000\\",584093,\\"sold_product_584093_12304, sold_product_584093_19587\\",\\"sold_product_584093_12304, sold_product_584093_19587\\",\\"75, 100\\",\\"75, 100\\",\\"Women's Shoes, Women's Clothing\\",\\"Women's Shoes, Women's Clothing\\",\\"Dec 25, 2016 @ 00:00:00.000, Dec 25, 2016 @ 00:00:00.000\\",\\"0, 0\\",\\"0, 0\\",\\"Primemaster, Oceanavigations\\",\\"Primemaster, Oceanavigations\\",\\"34.5, 47\\",\\"75, 100\\",\\"12,304, 19,587\\",\\"High heeled sandals - argento, Classic coat - black\\",\\"High heeled sandals - argento, Classic coat - black\\",\\"1, 1\\",\\"ZO0360303603, ZO0272002720\\",\\"0, 0\\",\\"75, 100\\",\\"75, 100\\",\\"0, 0\\",\\"ZO0360303603, ZO0272002720\\",175,175,2,2,order,diane +0QMtOW0BH63Xcmy432DJ,ecommerce,1,\\"Men's Clothing, Men's Accessories\\",\\"Men's Clothing, Men's Accessories\\",EUR,Eddie,Eddie,\\"Eddie Weber\\",\\"Eddie Weber\\",MALE,38,Weber,Weber,\\"(empty)\\",Monday,0,\\"eddie@weber-family.zzz\\",Cairo,Africa,EG,\\"POINT (31.3 30.1)\\",\\"Cairo Governorate\\",Elitelligence,Elitelligence,\\"Jun 30, 2019 @ 00:00:00.000\\",574916,\\"sold_product_574916_11262, sold_product_574916_15713\\",\\"sold_product_574916_11262, sold_product_574916_15713\\",\\"60, 20.984\\",\\"60, 20.984\\",\\"Men's Clothing, Men's Accessories\\",\\"Men's Clothing, Men's Accessories\\",\\"Dec 19, 2016 @ 00:00:00.000, Dec 19, 2016 @ 00:00:00.000\\",\\"0, 0\\",\\"0, 0\\",\\"Elitelligence, Elitelligence\\",\\"Elitelligence, Elitelligence\\",\\"28.203, 10.703\\",\\"60, 20.984\\",\\"11,262, 15,713\\",\\"Winter jacket - black, Watch - green\\",\\"Winter jacket - black, Watch - green\\",\\"1, 1\\",\\"ZO0542505425, ZO0601306013\\",\\"0, 0\\",\\"60, 20.984\\",\\"60, 20.984\\",\\"0, 0\\",\\"ZO0542505425, ZO0601306013\\",81,81,2,2,order,eddie +" +`; diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/event_log.ts b/x-pack/test/reporting_api_integration/reporting_and_security/event_log.ts new file mode 100644 index 0000000000000..d063655180e75 --- /dev/null +++ b/x-pack/test/reporting_api_integration/reporting_and_security/event_log.ts @@ -0,0 +1,87 @@ +/* + * 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 { omit } from 'lodash'; +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../ftr_provider_context'; + +// eslint-disable-next-line import/no-default-export +export default function ({ getService }: FtrProviderContext) { + const reportingAPI = getService('reportingAPI'); + const es = getService('es'); + + describe('Report generation event logging', () => { + before(async () => { + await reportingAPI.initEcommerce(); + }); + + after(async () => { + await reportingAPI.teardownEcommerce(); + }); + + it('creates a completed action for a PDF report', async () => { + const res = await reportingAPI.generateCsv({ + browserTimezone: 'UTC', + title: 'Test-PDF', + objectType: 'search', + searchSource: { + version: true, + fields: [{ field: '*', include_unmapped: 'true' }], + index: '5193f870-d861-11e9-a311-0fa548c5f953', + }, + columns: [], + version: '7.16.0', + }); + expect(res.status).to.eql(200); + expect(res.body.path).to.match(/download/); + + const { path } = res.body; + + // wait for the the pending job to complete + await reportingAPI.waitForJobToFinish(path); + + const csvFile = await reportingAPI.getCompletedJobOutput(path); + expectSnapshot(csvFile).toMatch(); + + // search for the raw event log data + const events = await es.search<{ event: any; kibana: { reporting: any } }>({ + index: '.kibana-event-log*', + filter_path: 'hits.hits._source.event,hits.hits._source.kibana', + query: { + bool: { + filter: [ + { + bool: { + must: [ + { term: { 'event.provider': 'reporting' } }, + { term: { 'event.action': 'execute-complete' } }, + ], + }, + }, + ], + }, + }, + sort: [{ '@timestamp': { order: 'desc' } }] as unknown as string[], + size: 1, + }); + + // validate the log has the expected fields with expected values + const logSource = events.hits.hits[0]._source; + expect(omit(logSource?.kibana.reporting, 'id')).to.eql({ + byteSize: 5943, + jobType: 'csv_searchsource', + }); + expect(omit(logSource?.event, ['duration', 'start', 'end'])).to.eql({ + action: 'execute-complete', + kind: 'metrics', + outcome: 'success', + provider: 'reporting', + timezone: 'UTC', + }); + }); + }); +} diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/index.ts b/x-pack/test/reporting_api_integration/reporting_and_security/index.ts index 02a2915fffd60..e2f70eed3a508 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/index.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/index.ts @@ -24,6 +24,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./bwc_existing_indexes')); loadTestFile(require.resolve('./security_roles_privileges')); loadTestFile(require.resolve('./download_csv_dashboard')); + loadTestFile(require.resolve('./event_log')); loadTestFile(require.resolve('./generate_csv_discover')); loadTestFile(require.resolve('./network_policy')); loadTestFile(require.resolve('./spaces')); From 54810f8b7cfa54e53bbb0c4c3e4e127d1513f2d2 Mon Sep 17 00:00:00 2001 From: Philipp Kahr Date: Thu, 3 Feb 2022 18:18:33 +0100 Subject: [PATCH 27/34] [APM] RUM documentation link is broken (#124478) * Link that is not a 404 --- .../common/tutorial/instructions/apm_agent_instructions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts b/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts index daac81298008e..695cf38bf2da2 100644 --- a/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts +++ b/x-pack/plugins/apm/common/tutorial/instructions/apm_agent_instructions.ts @@ -257,10 +257,10 @@ export const createJsAgentInstructions = (apmServerUrl = '') => [ { defaultMessage: 'APM Server disables RUM support by default. See the [documentation]({documentationLink}) \ -for details on how to enable RUM support.', +for details on how to enable RUM support. When using the APM integration with Fleet, RUM support is automatically enabled.', values: { documentationLink: - '{config.docs.base_url}guide/en/apm/server/{config.docs.version}/configuration-rum.html', + '{config.docs.base_url}guide/en/apm/guide/{config.docs.version}/configuration-rum.html', }, } ), From bb4509cf3bba264e19e884b55f39564364876756 Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Thu, 3 Feb 2022 18:35:24 +0100 Subject: [PATCH 28/34] :wrench: Use the new Records field from Lens (#124276) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../sample_data/data_sets/ecommerce/saved_objects.ts | 10 +++++----- .../sample_data/data_sets/logs/saved_objects.ts | 4 ++-- x-pack/plugins/data_visualizer/kibana.json | 1 + .../field_data_row/action_menu/lens_utils.ts | 9 +++++---- x-pack/plugins/osquery/kibana.json | 2 +- .../osquery/public/packs/pack_queries_status_table.tsx | 3 ++- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts index 25923f247ca8b..c2f56c1d6049d 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts @@ -544,7 +544,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Tx. last week', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', timeShift: '1w', }, 'ddc92e50-4d5c-413e-b91b-3e504889fa65': { @@ -554,7 +554,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Transactions', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', }, 'eadae280-2da3-4d1d-a0e1-f9733f89c15b': { customLabel: true, @@ -743,7 +743,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Count of records', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', }, '9f61a7df-198e-4754-b34c-81ed544136ba': { dataType: 'string', @@ -1070,7 +1070,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Items', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', }, 'd77cdd24-dedc-48dd-9a4b-d34c6f1a6c46': { customLabel: true, @@ -1186,7 +1186,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Items', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', }, 'd77cdd24-dedc-48dd-9a4b-d34c6f1a6c46': { customLabel: true, diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts index 840fc6e2c175c..aa2a0d077e30a 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts @@ -249,7 +249,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Part of count() / overall_sum(count())', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', }, 'b5f3dc78-dba8-4db8-87b6-24a0b9cca260X1': { customLabel: true, @@ -258,7 +258,7 @@ export const getSavedObjects = (): SavedObject[] => [ label: 'Part of count() / overall_sum(count())', operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: '___records___', }, 'b5f3dc78-dba8-4db8-87b6-24a0b9cca260X2': { customLabel: true, diff --git a/x-pack/plugins/data_visualizer/kibana.json b/x-pack/plugins/data_visualizer/kibana.json index 03f21bcde469d..aee54c216150c 100644 --- a/x-pack/plugins/data_visualizer/kibana.json +++ b/x-pack/plugins/data_visualizer/kibana.json @@ -30,6 +30,7 @@ "esUiShared", "fieldFormats", "uiActions", + "lens", "cloud" ], "owner": { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts index 3db1795456127..10ee347750e10 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts @@ -17,6 +17,7 @@ import type { TypedLensByValueInput, XYLayerConfig, } from '../../../../../../../lens/public'; +import { DOCUMENT_FIELD_NAME as RECORDS_FIELD } from '../../../../../../../lens/common/constants'; import { FieldVisConfig } from '../../stats_table/types'; import { JOB_FIELD_TYPES } from '../../../../../../common/constants'; @@ -52,7 +53,7 @@ export function getNumberSettings(item: FieldVisConfig, defaultIndexPattern: Ind label: COUNT, dataType: 'number', isBucketed: false, - sourceField: 'Records', + sourceField: RECORDS_FIELD, operationType: 'count', }, }; @@ -107,7 +108,7 @@ export function getDateSettings(item: FieldVisConfig) { label: COUNT, operationType: 'count', scale: 'ratio', - sourceField: 'Records', + sourceField: RECORDS_FIELD, }, col1: { dataType: 'date', @@ -148,7 +149,7 @@ export function getKeywordSettings(item: FieldVisConfig) { label: COUNT, dataType: 'number', isBucketed: false, - sourceField: 'Records', + sourceField: RECORDS_FIELD, operationType: 'count', }, }; @@ -181,7 +182,7 @@ export function getBooleanSettings(item: FieldVisConfig) { label: COUNT, dataType: 'number', isBucketed: false, - sourceField: 'Records', + sourceField: RECORDS_FIELD, operationType: 'count', }, }; diff --git a/x-pack/plugins/osquery/kibana.json b/x-pack/plugins/osquery/kibana.json index a499b2b75ee68..63f75b233f73b 100644 --- a/x-pack/plugins/osquery/kibana.json +++ b/x-pack/plugins/osquery/kibana.json @@ -8,7 +8,7 @@ }, "kibanaVersion": "kibana", "optionalPlugins": ["fleet", "home", "usageCollection", "lens"], - "requiredBundles": ["esUiShared", "fleet", "kibanaUtils", "kibanaReact"], + "requiredBundles": ["esUiShared", "fleet", "kibanaUtils", "kibanaReact", "lens"], "requiredPlugins": [ "actions", "data", diff --git a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx index 2bfe75e2833aa..8b8d361611a2d 100644 --- a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx +++ b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx @@ -30,6 +30,7 @@ import { PieVisualizationState, TermsIndexPatternColumn, } from '../../../lens/public'; +import { DOCUMENT_FIELD_NAME as RECORDS_FIELD } from '../../../lens/common/constants'; import { FilterStateStore, DataView } from '../../../../../src/plugins/data/common'; import { useKibana } from '../common/lib/kibana'; import { OsqueryManagerPackagePolicyInputStream } from '../../common/types'; @@ -91,7 +92,7 @@ function getLensAttributes( }, } as TermsIndexPatternColumn, 'ed999e9d-204c-465b-897f-fe1a125b39ed': { - sourceField: 'Records', + sourceField: RECORDS_FIELD, isBucketed: false, dataType: 'number', scale: 'ratio', From af9d3a1602732adabbdac67b87907665518f86d0 Mon Sep 17 00:00:00 2001 From: Abdul Wahab Zahid Date: Thu, 3 Feb 2022 18:58:20 +0100 Subject: [PATCH 29/34] Use `formatErrors` from utils instead of the default io-ts PathReporter for a concise report of schema validation errors. (#124555) --- .../plugins/uptime/public/state/api/utils.ts | 36 ++----------------- .../synthetics_service/monitor_validation.ts | 6 ++-- 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/x-pack/plugins/uptime/public/state/api/utils.ts b/x-pack/plugins/uptime/public/state/api/utils.ts index c0b403d8884e8..833a6845d6343 100644 --- a/x-pack/plugins/uptime/public/state/api/utils.ts +++ b/x-pack/plugins/uptime/public/state/api/utils.ts @@ -5,41 +5,11 @@ * 2.0. */ -import { PathReporter } from 'io-ts/lib/PathReporter'; import { isRight } from 'fp-ts/lib/Either'; +import { formatErrors } from '@kbn/securitysolution-io-ts-utils'; import { HttpFetchQuery, HttpSetup } from 'src/core/public'; -import * as t from 'io-ts'; import { FETCH_STATUS, AddInspectorRequest } from '../../../../observability/public'; -function isObject(value: unknown) { - const type = typeof value; - return value != null && (type === 'object' || type === 'function'); -} - -/** - * @deprecated Use packages/kbn-securitysolution-io-ts-utils/src/format_errors/index.ts - */ -export const formatErrors = (errors: t.Errors): string[] => { - return errors.map((error) => { - if (error.message != null) { - return error.message; - } else { - const keyContext = error.context - .filter( - (entry) => entry.key != null && !Number.isInteger(+entry.key) && entry.key.trim() !== '' - ) - .map((entry) => entry.key) - .join('.'); - - const nameContext = error.context.find((entry) => entry.type?.name?.length > 0); - const suppliedValue = - keyContext !== '' ? keyContext : nameContext != null ? nameContext.type.name : ''; - const value = isObject(error.value) ? JSON.stringify(error.value) : error.value; - return `Invalid value "${value}" supplied to "${suppliedValue}"`; - } - }); -}; - class ApiService { private static instance: ApiService; private _http!: HttpSetup; @@ -118,7 +88,7 @@ class ApiService { } else { // eslint-disable-next-line no-console console.warn( - `API ${apiUrl} is not returning expected response, ${PathReporter.report(decoded)}` + `API ${apiUrl} is not returning expected response, ${formatErrors(decoded.left)}` ); } } @@ -138,7 +108,7 @@ class ApiService { } else { // eslint-disable-next-line no-console console.warn( - `API ${apiUrl} is not returning expected response, ${PathReporter.report(decoded)}` + `API ${apiUrl} is not returning expected response, ${formatErrors(decoded.left)}` ); } } diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/monitor_validation.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/monitor_validation.ts index 9f14c414e5cad..446eaa5847319 100644 --- a/x-pack/plugins/uptime/server/rest_api/synthetics_service/monitor_validation.ts +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/monitor_validation.ts @@ -6,7 +6,7 @@ */ import { isLeft } from 'fp-ts/lib/Either'; -import { PathReporter } from 'io-ts/lib/PathReporter'; +import { formatErrors } from '@kbn/securitysolution-io-ts-utils'; import { BrowserFieldsCodec, @@ -49,7 +49,7 @@ export function validateMonitor(monitorFields: MonitorFields): { return { valid: false, reason: `Monitor type is invalid`, - details: PathReporter.report(decodedType).join(' | '), + details: formatErrors(decodedType.left).join(' | '), payload: monitorFields, }; } @@ -72,7 +72,7 @@ export function validateMonitor(monitorFields: MonitorFields): { return { valid: false, reason: `Monitor is not a valid monitor of type ${monitorType}`, - details: PathReporter.report(decodedMonitor).join(' | '), + details: formatErrors(decodedMonitor.left).join(' | '), payload: monitorFields, }; } From 52f0ea20fe49efdfd6bbb23469b7872c876d1c99 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 3 Feb 2022 19:05:19 +0100 Subject: [PATCH 30/34] [TSVB] Fix series containing colon (#123897) --- .../vis_types/timeseries/common/constants.ts | 1 + .../components/lib/get_click_filter_data.test.ts | 5 +++-- .../components/lib/get_click_filter_data.ts | 3 ++- .../components/vis_types/top_n/vis.js | 5 +++-- .../application/components/vis_with_splits.js | 5 +++-- .../lib/vis_data/helpers/get_splits.test.ts | 16 ++++++++-------- .../server/lib/vis_data/helpers/get_splits.ts | 5 +++-- .../vis_data/response_processors/series/math.js | 3 ++- .../response_processors/series/math.test.js | 2 +- .../response_processors/series/percentile.js | 3 ++- .../series/percentile.test.js | 4 ++-- .../series/percentile_rank.js | 3 ++- .../series/percentile_rank.test.ts | 4 ++-- .../response_processors/series/series_agg.js | 3 ++- .../response_processors/table/series_agg.ts | 3 ++- 15 files changed, 38 insertions(+), 27 deletions(-) diff --git a/src/plugins/vis_types/timeseries/common/constants.ts b/src/plugins/vis_types/timeseries/common/constants.ts index 30fb814990925..cbaf275cc0092 100644 --- a/src/plugins/vis_types/timeseries/common/constants.ts +++ b/src/plugins/vis_types/timeseries/common/constants.ts @@ -11,6 +11,7 @@ export const UI_SETTINGS = { ALLOW_STRING_INDICES: 'metrics:allowStringIndices', ALLOW_CHECKING_FOR_FAILED_SHARDS: 'metrics:allowCheckingForFailedShards', }; +export const SERIES_SEPARATOR = '╰┄►'; export const INDEXES_SEPARATOR = ','; export const AUTO_INTERVAL = 'auto'; export const ROUTES = { diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.test.ts b/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.test.ts index 80c84ff125817..f79665fdca5ec 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.test.ts +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.test.ts @@ -9,6 +9,7 @@ import { XYChartSeriesIdentifier, GeometryValue } from '@elastic/charts'; import { getClickFilterData } from './get_click_filter_data'; import type { TSVBTables } from './types'; import { TimeseriesVisParams } from '../../../types'; +import { SERIES_SEPARATOR } from '../../../../common/constants'; describe('getClickFilterData', () => { test('gets the correct data for a group by everything timeseries chart', () => { @@ -102,7 +103,7 @@ describe('getClickFilterData', () => { }, { key: 'groupId{yaxis_6e0353a0-ad9b-11eb-b112-89cce8e43380_main_group}spec{61ca57f1-469d-11e7-af02-69e470af7417:1}yAccessor{1}splitAccessors{}', - specId: '61ca57f1-469d-11e7-af02-69e470af7417:1', + specId: '61ca57f1-469d-11e7-af02-69e470af7417╰┄►1', }, ], ] as Array<[GeometryValue, XYChartSeriesIdentifier]>; @@ -199,7 +200,7 @@ describe('getClickFilterData', () => { expect(data[1].column).toEqual(2); expect(data[1].row).toEqual(10); // expect(data).toEqual([]); - const splitValue = points[0][1].specId.split(':'); + const splitValue = points[0][1].specId.split(SERIES_SEPARATOR); expect(data[1].value).toEqual(parseInt(splitValue[1], 10)); }); }); diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.ts b/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.ts index a6e35aa6e1032..a3da470f6155c 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.ts +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/get_click_filter_data.ts @@ -11,6 +11,7 @@ import { X_ACCESSOR_INDEX } from '../../visualizations/constants'; import { BUCKET_TYPES } from '../../../../common/enums'; import { TimeseriesVisParams } from '../../../types'; import type { TSVBTables } from './types'; +import { SERIES_SEPARATOR } from '../../../../common/constants'; export const getClickFilterData = ( points: Array<[GeometryValue, XYChartSeriesIdentifier]>, @@ -23,7 +24,7 @@ export const getClickFilterData = ( const { specId } = point[1]; // specId for a split series has the format // 61ca57f1-469d-11e7-af02-69e470af7417:Men's Accessories, : - const [layerId, splitLabel] = specId.split(':'); + const [layerId, splitLabel] = specId.split(SERIES_SEPARATOR); const table = tables[layerId]; const layer = model.series.filter(({ id }) => id === layerId); diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/vis.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/vis.js index 5eb850a753384..20caa14ea8cb6 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/vis.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/vis.js @@ -20,6 +20,7 @@ import { sortBy, first, get } from 'lodash'; import { DATA_FORMATTERS } from '../../../../../common/enums'; import { getOperator, shouldOperate } from '../../../../../common/operators_utils'; import { ExternalUrlErrorModal } from '../../lib/external_url_error_modal'; +import { SERIES_SEPARATOR } from '../../../../../common/constants'; function sortByDirection(data, direction, fn) { if (direction === 'desc') { @@ -32,7 +33,7 @@ function sortSeries(visData, model) { const series = get(visData, `${model.id}.series`, []); return model.series.reduce((acc, item) => { const itemSeries = series.filter((s) => { - const id = first(s.id.split(/:/)); + const id = first(s.id.split(SERIES_SEPARATOR)); return id === item.id; }); const direction = item.terms_direction || 'desc'; @@ -47,7 +48,7 @@ function TopNVisualization(props) { const { backgroundColor, model, visData, fieldFormatMap, getConfig } = props; const series = sortSeries(visData, model).map((item) => { - const id = first(item.id.split(/:/)); + const id = first(item.id.split(SERIES_SEPARATOR)); const seriesConfig = model.series.find((s) => s.id === id); if (seriesConfig) { const tickFormatter = diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_with_splits.js b/src/plugins/vis_types/timeseries/public/application/components/vis_with_splits.js index b8ce63bd35dca..8f700228cc71e 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_with_splits.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_with_splits.js @@ -13,6 +13,7 @@ import { labelDateFormatter } from './lib/label_date_formatter'; import { findIndex, first } from 'lodash'; import { getValueOrEmpty } from '../../../common/empty_label'; import { getSplitByTermsColor } from '../lib/get_split_by_terms_color'; +import { SERIES_SEPARATOR } from '../../../common/constants'; export function visWithSplits(WrappedComponent) { function SplitVisComponent(props) { @@ -43,12 +44,12 @@ export function visWithSplits(WrappedComponent) { ); if (!model || !visData || !visData[model.id]) return ; - if (visData[model.id].series.every((s) => s.id.split(':').length === 1)) { + if (visData[model.id].series.every((s) => s.id.split(SERIES_SEPARATOR).length === 1)) { return ; } const splitsVisData = visData[model.id].series.reduce((acc, series) => { - const [seriesId, splitId] = series.id.split(':'); + const [seriesId, splitId] = series.id.split(SERIES_SEPARATOR); const seriesModel = model.series.find((s) => s.id === seriesId); if (!seriesModel) return acc; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.test.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.test.ts index 5dbeb915df28c..d6bdd452825fd 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.test.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.test.ts @@ -79,7 +79,7 @@ describe('getSplits(resp, panel, series)', () => { expect(await getSplits(resp, panel, series, undefined, () => [])).toEqual([ { - id: 'SERIES:example-01', + id: 'SERIES╰┄►example-01', key: 'example-01', label: 'example-01', labelFormatted: '', @@ -90,7 +90,7 @@ describe('getSplits(resp, panel, series)', () => { SIBAGG: { value: 1 }, }, { - id: 'SERIES:example-02', + id: 'SERIES╰┄►example-02', key: 'example-02', label: 'example-02', labelFormatted: '', @@ -138,7 +138,7 @@ describe('getSplits(resp, panel, series)', () => { const panel = { type: 'top_n' } as Panel; expect(await getSplits(resp, panel, series, undefined, () => [])).toEqual([ { - id: 'SERIES:example-01', + id: 'SERIES╰┄►example-01', key: 'example-01', label: '--example-01--', labelFormatted: '', @@ -149,7 +149,7 @@ describe('getSplits(resp, panel, series)', () => { SIBAGG: { value: 1 }, }, { - id: 'SERIES:example-02', + id: 'SERIES╰┄►example-02', key: 'example-02', label: '--example-02--', labelFormatted: '', @@ -200,7 +200,7 @@ describe('getSplits(resp, panel, series)', () => { expect(await getSplits(resp, panel, series, undefined, () => [])).toEqual([ { - id: 'SERIES:example-01', + id: 'SERIES╰┄►example-01', key: 'example-01', key_as_string: 'false', label: '--example-01--', @@ -212,7 +212,7 @@ describe('getSplits(resp, panel, series)', () => { SIBAGG: { value: 1 }, }, { - id: 'SERIES:example-02', + id: 'SERIES╰┄►example-02', key: 'example-02', key_as_string: 'true', label: '--example-02--', @@ -256,7 +256,7 @@ describe('getSplits(resp, panel, series)', () => { expect(await getSplits(resp, panel, series, undefined, () => [])).toEqual([ { - id: 'SERIES:filter-1', + id: 'SERIES╰┄►filter-1', key: 'filter-1', label: '200s', meta: { bucketSize: 10 }, @@ -265,7 +265,7 @@ describe('getSplits(resp, panel, series)', () => { timeseries: { buckets: [] }, }, { - id: 'SERIES:filter-2', + id: 'SERIES╰┄►filter-2', key: 'filter-2', label: '300s', splitByLabel: 'Count', diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.ts index 6be53ef3f03ff..1754fa6569dcd 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_splits.ts @@ -11,6 +11,7 @@ import { get, isPlainObject } from 'lodash'; import { overwrite } from '../helpers'; import { calculateLabel } from '../../../../common/calculate_label'; +import { SERIES_SEPARATOR } from '../../../../common/constants'; import { getLastMetric } from './get_last_metric'; import { formatKey } from './format_key'; @@ -66,7 +67,7 @@ export async function getSplits { const bucket = get(resp, `aggregations.${series.id}.buckets.${filter.id}`); - bucket.id = `${series.id}:${filter.id}`; + bucket.id = `${series.id}${SERIES_SEPARATOR}${filter.id}`; bucket.key = filter.id; bucket.splitByLabel = splitByLabel; bucket.color = filter.color; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.js index a6addc8ba0e53..46dde6653647d 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.js @@ -7,6 +7,7 @@ */ import { convertIntervalToUnit } from '../../helpers/unit_to_seconds'; +import { SERIES_SEPARATOR } from '../../../../../common/constants'; const percentileValueMatch = /\[([0-9\.]+)\]$/; import { startsWith, flatten, values, first, last } from 'lodash'; @@ -20,7 +21,7 @@ export function mathAgg(resp, panel, series, meta, extractFields) { // Filter the results down to only the ones that match the series.id. Sometimes // there will be data from other series mixed in. results = results.filter((s) => { - if (s.id.split(/:/)[0] === series.id) { + if (s.id.split(SERIES_SEPARATOR)[0] === series.id) { return false; } return true; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.test.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.test.js index d8508f6b735a0..14c66866d323a 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.test.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/math.test.js @@ -93,7 +93,7 @@ describe('math(resp, panel, series)', () => { expect(results).toHaveLength(1); expect(results[0]).toEqual({ - id: 'test:example-01', + id: 'test╰┄►example-01', label: 'example-01', color: 'rgb(255, 0, 0)', stack: false, diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.js index fe8a6ff9cd2f6..a0fe57ea5cfcf 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.js @@ -11,6 +11,7 @@ import { getDefaultDecoration } from '../../helpers/get_default_decoration'; import { getSplits } from '../../helpers/get_splits'; import { getLastMetric } from '../../helpers/get_last_metric'; import { TSVB_METRIC_TYPES } from '../../../../../common/enums'; +import { SERIES_SEPARATOR } from '../../../../../common/constants'; export function percentile(resp, panel, series, meta, extractFields) { return (next) => async (results) => { @@ -23,7 +24,7 @@ export function percentile(resp, panel, series, meta, extractFields) { (await getSplits(resp, panel, series, meta, extractFields)).forEach((split) => { metric.percentiles.forEach((percentile) => { const percentileValue = percentile.value ? percentile.value : 0; - const id = `${split.id}:${percentile.id}`; + const id = `${split.id}${SERIES_SEPARATOR}${percentile.id}`; const data = split.timeseries.buckets.map((bucket) => { const higherMetric = { ...metric, percent: percentileValue }; const serieData = [bucket.key, getAggValue(bucket, higherMetric)]; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.test.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.test.js index de304913d6c69..ea1efdcd0c41b 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.test.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile.test.js @@ -83,7 +83,7 @@ describe('percentile(resp, panel, series)', () => { expect(results).toHaveLength(2); - expect(results[0]).toHaveProperty('id', 'test:10-90'); + expect(results[0]).toHaveProperty('id', 'test╰┄►10-90'); expect(results[0]).toHaveProperty('color', '#000028'); expect(results[0]).toHaveProperty('label', 'Percentile of cpu'); expect(results[0]).toHaveProperty('lines'); @@ -100,7 +100,7 @@ describe('percentile(resp, panel, series)', () => { [2, 1.2, 5.3], ]); - expect(results[1]).toHaveProperty('id', 'test:50'); + expect(results[1]).toHaveProperty('id', 'test╰┄►50'); expect(results[1]).toHaveProperty('color', 'rgb(255, 0, 0)'); expect(results[1]).toHaveProperty('label', '(50) Percentile of cpu'); expect(results[1]).toHaveProperty('stack', false); diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js index ce81ec46693e2..0720c6e19a9c0 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js @@ -12,6 +12,7 @@ import { getSplits } from '../../helpers/get_splits'; import { getLastMetric } from '../../helpers/get_last_metric'; import { toPercentileNumber } from '../../../../../common/to_percentile_number'; import { TSVB_METRIC_TYPES } from '../../../../../common/enums'; +import { SERIES_SEPARATOR } from '../../../../../common/constants'; export function percentileRank(resp, panel, series, meta, extractFields) { return (next) => async (results) => { @@ -33,7 +34,7 @@ export function percentileRank(resp, panel, series, meta, extractFields) { results.push({ data, - id: `${split.id}:${percentileRank}:${index}`, + id: `${split.id}${SERIES_SEPARATOR}${percentileRank}${SERIES_SEPARATOR}${index}`, label: `(${percentileRank || 0}) ${split.label}`, color: series.split_mode === 'everything' && metric.colors diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.test.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.test.ts index 79c3eab91c3c9..758c37130cdd4 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.test.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/percentile_rank.test.ts @@ -75,7 +75,7 @@ describe('percentile_rank(resp, panel, series, meta, extractFields)', () => { expect(results).toHaveLength(2); - expect(results[0]).toHaveProperty('id', 'test:1000:0'); + expect(results[0]).toHaveProperty('id', 'test╰┄►1000╰┄►0'); expect(results[0]).toHaveProperty('color', '#000028'); expect(results[0]).toHaveProperty('label', '(1000) Percentile Rank of cpu'); expect(results[0].data).toEqual([ @@ -83,7 +83,7 @@ describe('percentile_rank(resp, panel, series, meta, extractFields)', () => { [2, 1], ]); - expect(results[1]).toHaveProperty('id', 'test:500:1'); + expect(results[1]).toHaveProperty('id', 'test╰┄►500╰┄►1'); expect(results[1]).toHaveProperty('color', '#0000FF'); expect(results[1]).toHaveProperty('label', '(500) Percentile Rank of cpu'); expect(results[1].data).toEqual([ diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/series_agg.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/series_agg.js index a803439c7581f..532f5fd07f597 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/series_agg.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/series/series_agg.js @@ -9,6 +9,7 @@ import { last, first } from 'lodash'; import { SeriesAgg } from './_series_agg'; import { getDefaultDecoration } from '../../helpers/get_default_decoration'; import { calculateLabel } from '../../../../../common/calculate_label'; +import { SERIES_SEPARATOR } from '../../../../../common/constants'; export function seriesAgg(resp, panel, series, meta, extractFields) { return (next) => async (results) => { @@ -19,7 +20,7 @@ export function seriesAgg(resp, panel, series, meta, extractFields) { // Filter out the seires with the matching metric and store them // in targetSeries results = results.filter((s) => { - if (s.id.split(/:/)[0] === series.id) { + if (s.id.split(SERIES_SEPARATOR)[0] === series.id) { targetSeries.push(s.data); return false; } diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/table/series_agg.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/table/series_agg.ts index d360bb97333c7..b4bc082bab849 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/table/series_agg.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/response_processors/table/series_agg.ts @@ -9,6 +9,7 @@ import { last } from 'lodash'; import { calculateLabel } from '../../../../../common/calculate_label'; +import { SERIES_SEPARATOR } from '../../../../../common/constants'; // @ts-expect-error no typed yet import { SeriesAgg } from './_series_agg'; @@ -26,7 +27,7 @@ export const seriesAgg: TableResponseProcessorsFunction = // Filter out the seires with the matching metric and store them // in targetSeries results = results.filter((s) => { - if (s.id && s.id.split(/:/)[0] === series.id) { + if (s.id && s.id.split(SERIES_SEPARATOR)[0] === series.id) { targetSeries.push(s.data!); return false; } From 7369e2f48d4dc3ed5edbc96d9714a80a638db092 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Thu, 3 Feb 2022 21:00:31 +0100 Subject: [PATCH 31/34] [Uptime] Added test now mode for monitors (#123712) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../uptime/common/constants/rest_api.ts | 1 + .../common/runtime_types/monitor/state.ts | 2 + .../uptime/common/runtime_types/ping/ping.ts | 1 + .../browser/browser_test_results.tsx | 2 +- .../use_browser_run_once_monitors.test.tsx | 2 +- .../browser/use_browser_run_once_monitors.ts | 37 +++++-- .../simple/simple_test_results.tsx | 2 +- .../simple/use_simple_run_once_monitors.ts | 23 +++- .../test_now_mode/test_result_header.tsx | 6 +- .../test_now_mode/use_tick_tick.ts | 15 ++- .../columns/monitor_status_column.test.tsx | 17 ++- .../columns/monitor_status_column.tsx | 100 ++++++++++++++---- .../progress/browser_monitor_progress.tsx | 89 ++++++++++++++++ .../columns/progress/monitor_progress.tsx | 61 +++++++++++ .../progress/simple_monitor_progress.tsx | 62 +++++++++++ .../columns/progress/use_updated_monitor.ts | 44 ++++++++ .../monitor_list/columns/test_now_col.tsx | 60 +++++++++++ .../monitor_list/monitor_list.test.tsx | 17 ++- .../overview/monitor_list/monitor_list.tsx | 92 ++++++++++++---- .../monitor_list/monitor_list_container.tsx | 16 ++- .../overview/monitor_list/translations.ts | 4 + .../public/lib/__mocks__/uptime_store.mock.ts | 4 + .../public/state/actions/monitor_list.ts | 16 +++ .../public/state/api/monitor_management.ts | 10 ++ .../uptime/public/state/effects/index.ts | 8 +- .../public/state/effects/monitor_list.ts | 26 ++++- .../uptime/public/state/reducers/index.ts | 2 + .../public/state/reducers/monitor_list.ts | 79 +++++++++++++- .../public/state/reducers/test_now_runs.ts | 82 ++++++++++++++ .../search/refine_potential_matches.ts | 2 + .../synthetics_service/synthetics_service.ts | 36 ++++++- .../plugins/uptime/server/rest_api/index.ts | 2 + .../synthetics_service/add_monitor.ts | 4 + .../synthetics_service/edit_monitor.ts | 4 + .../synthetics_service/test_now_monitor.ts | 48 +++++++++ 35 files changed, 895 insertions(+), 81 deletions(-) create mode 100644 x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx create mode 100644 x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx create mode 100644 x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx create mode 100644 x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/use_updated_monitor.ts create mode 100644 x-pack/plugins/uptime/public/components/overview/monitor_list/columns/test_now_col.tsx create mode 100644 x-pack/plugins/uptime/public/state/reducers/test_now_runs.ts create mode 100644 x-pack/plugins/uptime/server/rest_api/synthetics_service/test_now_monitor.ts diff --git a/x-pack/plugins/uptime/common/constants/rest_api.ts b/x-pack/plugins/uptime/common/constants/rest_api.ts index 2c369579b0150..f1b0b69ba61ec 100644 --- a/x-pack/plugins/uptime/common/constants/rest_api.ts +++ b/x-pack/plugins/uptime/common/constants/rest_api.ts @@ -41,4 +41,5 @@ export enum API_URLS { SERVICE_LOCATIONS = '/internal/uptime/service/locations', SYNTHETICS_MONITORS = '/internal/uptime/service/monitors', RUN_ONCE_MONITOR = '/internal/uptime/service/monitors/run_once', + TRIGGER_MONITOR = '/internal/uptime/service/monitors/trigger', } diff --git a/x-pack/plugins/uptime/common/runtime_types/monitor/state.ts b/x-pack/plugins/uptime/common/runtime_types/monitor/state.ts index fc2cd42500d6c..d43fd5ad001f2 100644 --- a/x-pack/plugins/uptime/common/runtime_types/monitor/state.ts +++ b/x-pack/plugins/uptime/common/runtime_types/monitor/state.ts @@ -27,6 +27,7 @@ export const StateType = t.intersection([ monitor: t.intersection([ t.partial({ name: t.string, + duration: t.type({ us: t.number }), }), t.type({ type: t.string, @@ -73,6 +74,7 @@ export const MonitorSummaryType = t.intersection([ t.partial({ histogram: HistogramType, minInterval: t.number, + configId: t.string, }), ]); diff --git a/x-pack/plugins/uptime/common/runtime_types/ping/ping.ts b/x-pack/plugins/uptime/common/runtime_types/ping/ping.ts index f4a9fe31b2885..989d6d8ef941a 100644 --- a/x-pack/plugins/uptime/common/runtime_types/ping/ping.ts +++ b/x-pack/plugins/uptime/common/runtime_types/ping/ping.ts @@ -220,6 +220,7 @@ export const PingType = t.intersection([ service: t.partial({ name: t.string, }), + config_id: t.string, }), ]); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/browser_test_results.tsx b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/browser_test_results.tsx index d5dd333f7f6c7..5dc893356b214 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/browser_test_results.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/browser_test_results.tsx @@ -20,7 +20,7 @@ interface Props { export const BrowserTestRunResult = ({ monitorId }: Props) => { const { data, loading, stepEnds, journeyStarted, summaryDoc, stepListData } = useBrowserRunOnceMonitors({ - monitorId, + configId: monitorId, }); const hits = data?.hits.hits; diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx index 3a126e6f69e99..f467bb642a13e 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx @@ -26,7 +26,7 @@ describe('useBrowserRunOnceMonitors', function () { }, }); - const { result } = renderHook(() => useBrowserRunOnceMonitors({ monitorId: 'test-id' }), { + const { result } = renderHook(() => useBrowserRunOnceMonitors({ configId: 'test-id' }), { wrapper: WrappedHelper, }); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts index 41f2b1cbe11f8..d051eaebe392e 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts @@ -15,10 +15,12 @@ import { fetchJourneySteps } from '../../../../state/api/journey'; import { isStepEnd } from '../../../synthetics/check_steps/steps_list'; export const useBrowserEsResults = ({ - monitorId, + configId, + testRunId, lastRefresh, }: { - monitorId: string; + configId: string; + testRunId?: string; lastRefresh: number; }) => { const { settings } = useSelector(selectDynamicSettings); @@ -37,7 +39,7 @@ export const useBrowserEsResults = ({ filter: [ { term: { - config_id: monitorId, + config_id: configId, }, }, { @@ -45,28 +47,47 @@ export const useBrowserEsResults = ({ 'synthetics.type': ['heartbeat/summary', 'journey/start'], }, }, + ...(testRunId + ? [ + { + term: { + test_run_id: testRunId, + }, + }, + ] + : []), ], }, }, }, size: 10, }), - [monitorId, settings?.heartbeatIndices, lastRefresh], + [configId, settings?.heartbeatIndices, lastRefresh], { name: 'TestRunData' } ); }; -export const useBrowserRunOnceMonitors = ({ monitorId }: { monitorId: string }) => { - const { refreshTimer, lastRefresh } = useTickTick(); +export const useBrowserRunOnceMonitors = ({ + configId, + testRunId, + skipDetails = false, + refresh = true, +}: { + configId: string; + testRunId?: string; + refresh?: boolean; + skipDetails?: boolean; +}) => { + const { refreshTimer, lastRefresh } = useTickTick(3 * 1000, refresh); const [checkGroupId, setCheckGroupId] = useState(''); const [stepEnds, setStepEnds] = useState([]); const [summary, setSummary] = useState(); - const { data, loading } = useBrowserEsResults({ monitorId, lastRefresh }); + const { data, loading } = useBrowserEsResults({ configId, testRunId, lastRefresh }); const { data: stepListData } = useFetcher(() => { - if (checkGroupId) { + if (checkGroupId && !skipDetails) { return fetchJourneySteps({ checkGroup: checkGroupId, }); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx index 97097285d0bbc..507082c7fefb1 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx @@ -15,7 +15,7 @@ interface Props { } export function SimpleTestResults({ monitorId }: Props) { const [summaryDocs, setSummaryDocs] = useState([]); - const { summaryDoc, loading } = useSimpleRunOnceMonitors({ monitorId }); + const { summaryDoc, loading } = useSimpleRunOnceMonitors({ configId: monitorId }); useEffect(() => { if (summaryDoc) { diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts index 816f9b019c45a..fc43844103f25 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts @@ -12,8 +12,14 @@ import { Ping } from '../../../../../common/runtime_types'; import { createEsParams, useEsSearch } from '../../../../../../observability/public'; import { useTickTick } from '../use_tick_tick'; -export const useSimpleRunOnceMonitors = ({ monitorId }: { monitorId: string }) => { - const { refreshTimer, lastRefresh } = useTickTick(); +export const useSimpleRunOnceMonitors = ({ + configId, + testRunId, +}: { + configId: string; + testRunId?: string; +}) => { + const { refreshTimer, lastRefresh } = useTickTick(2 * 1000, false); const { settings } = useSelector(selectDynamicSettings); @@ -31,7 +37,7 @@ export const useSimpleRunOnceMonitors = ({ monitorId }: { monitorId: string }) = filter: [ { term: { - config_id: monitorId, + config_id: configId, }, }, { @@ -39,13 +45,22 @@ export const useSimpleRunOnceMonitors = ({ monitorId }: { monitorId: string }) = field: 'summary', }, }, + ...(testRunId + ? [ + { + term: { + test_run_id: testRunId, + }, + }, + ] + : []), ], }, }, }, size: 10, }), - [monitorId, settings?.heartbeatIndices, lastRefresh], + [configId, settings?.heartbeatIndices, lastRefresh], { name: 'TestRunData' } ); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/test_result_header.tsx b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/test_result_header.tsx index 51b120c3c7e5e..00caa48e5dc08 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/test_result_header.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/test_result_header.tsx @@ -63,7 +63,7 @@ export function TestResultHeader({ doc, title, summaryDocs, journeyStarted, isCo - {journeyStarted ? IN_PROGRESS : PENDING_LABEL} + {journeyStarted ? IN_PROGRESS_LABEL : PENDING_LABEL} @@ -86,7 +86,7 @@ export function TestResultHeader({ doc, title, summaryDocs, journeyStarted, isCo ); } -const PENDING_LABEL = i18n.translate('xpack.uptime.monitorManagement.pending', { +export const PENDING_LABEL = i18n.translate('xpack.uptime.monitorManagement.pending', { defaultMessage: 'PENDING', }); @@ -98,7 +98,7 @@ const COMPLETED_LABEL = i18n.translate('xpack.uptime.monitorManagement.completed defaultMessage: 'COMPLETED', }); -const IN_PROGRESS = i18n.translate('xpack.uptime.monitorManagement.inProgress', { +export const IN_PROGRESS_LABEL = i18n.translate('xpack.uptime.monitorManagement.inProgress', { defaultMessage: 'IN PROGRESS', }); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/use_tick_tick.ts b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/use_tick_tick.ts index ff9b9f3f6154d..ce6d88806144c 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/use_tick_tick.ts +++ b/x-pack/plugins/uptime/public/components/monitor_management/test_now_mode/use_tick_tick.ts @@ -8,13 +8,18 @@ import { useEffect, useState, useContext } from 'react'; import { UptimeRefreshContext } from '../../../contexts'; -export function useTickTick() { - const { refreshApp, lastRefresh } = useContext(UptimeRefreshContext); +export function useTickTick(interval?: number, refresh = true) { + const { refreshApp } = useContext(UptimeRefreshContext); + + const [nextTick, setNextTick] = useState(Date.now()); const [tickTick] = useState(() => setInterval(() => { - refreshApp(); - }, 5 * 1000) + if (refresh) { + refreshApp(); + } + setNextTick(Date.now()); + }, interval ?? 5 * 1000) ); useEffect(() => { @@ -23,5 +28,5 @@ export function useTickTick() { }; }, [tickTick]); - return { refreshTimer: tickTick, lastRefresh }; + return { refreshTimer: tickTick, lastRefresh: nextTick }; } diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx index c05cc1e4b2a92..02fe666b79464 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx @@ -229,7 +229,12 @@ describe('MonitorListStatusColumn', () => { it('provides expected tooltip and display times', async () => { const { getByText } = render( - + ); @@ -244,7 +249,12 @@ describe('MonitorListStatusColumn', () => { it('can handle a non-numeric timestamp value', () => { const { getByText } = render( - + ); @@ -259,6 +269,7 @@ describe('MonitorListStatusColumn', () => { ping.observer!.geo!.name! === 'Islamabad')} /> @@ -278,6 +289,7 @@ describe('MonitorListStatusColumn', () => { status="up" timestamp={new Date().toString()} summaryPings={summaryPings} + monitorType="http" /> ); @@ -295,6 +307,7 @@ describe('MonitorListStatusColumn', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.tsx index 6960bb5632852..60baedaa7830c 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/monitor_status_column.tsx @@ -5,13 +5,23 @@ * 2.0. */ -import React, { useContext } from 'react'; -import moment from 'moment'; +import React, { useCallback, useContext } from 'react'; +import moment, { Moment } from 'moment'; import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; -import { EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip, EuiBadge, EuiSpacer } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiToolTip, + EuiBadge, + EuiSpacer, + EuiHighlight, + EuiHorizontalRule, +} from '@elastic/eui'; +import { useDispatch, useSelector } from 'react-redux'; import { parseTimestamp } from '../parse_timestamp'; -import { Ping } from '../../../../../common/runtime_types'; +import { DataStream, Ping } from '../../../../../common/runtime_types'; import { STATUS, SHORT_TIMESPAN_LOCALE, @@ -22,10 +32,18 @@ import { import { UptimeThemeContext } from '../../../../contexts'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { STATUS_DOWN_LABEL, STATUS_UP_LABEL } from '../../../common/translations'; +import { MonitorProgress } from './progress/monitor_progress'; +import { refreshedMonitorSelector } from '../../../../state/reducers/monitor_list'; +import { testNowRunSelector } from '../../../../state/reducers/test_now_runs'; +import { clearTestNowMonitorAction } from '../../../../state/actions'; interface MonitorListStatusColumnProps { + configId?: string; + monitorId?: string; status: string; + monitorType: string; timestamp: string; + duration?: number; summaryPings: Ping[]; } @@ -63,7 +81,7 @@ export const getShortTimeStamp = (timeStamp: moment.Moment, relative = false) => shortTimestamp = timeStamp.fromNow(); } - // Reset it so, it does't impact other part of the app + // Reset it so, it doesn't impact other part of the app moment.locale(prevLocale); return shortTimestamp; } else { @@ -144,7 +162,11 @@ export const getLocationStatus = (summaryPings: Ping[], status: string) => { }; export const MonitorListStatusColumn = ({ + monitorType, + configId, + monitorId, status, + duration, summaryPings = [], timestamp: tsString, }: MonitorListStatusColumnProps) => { @@ -156,16 +178,39 @@ export const MonitorListStatusColumn = ({ const { statusMessage, locTooltip } = getLocationStatus(summaryPings, status); + const dispatch = useDispatch(); + + const stopProgressTrack = useCallback(() => { + if (configId) { + dispatch(clearTestNowMonitorAction(configId)); + } + }, [configId, dispatch]); + + const refreshedMonitorIds = useSelector(refreshedMonitorSelector); + + const testNowRun = useSelector(testNowRunSelector(configId)); + return (
- + - - {getHealthMessage(status)} - + {testNowRun && configId && testNowRun?.testRunId ? ( + + ) : ( + + {getHealthMessage(status)} + + )} @@ -183,20 +228,39 @@ export const MonitorListStatusColumn = ({ - {timestamp.toLocaleString()} - + <> + + {timestamp.fromNow()} + + + + {timestamp.toLocaleString()} + + } > - - Checked {getShortTimeStamp(timestamp)} - + {monitorId && refreshedMonitorIds?.includes(monitorId) ? ( + + {getCheckedLabel(timestamp)} + + ) : ( + + {getCheckedLabel(timestamp)} + + )}
); }; +const getCheckedLabel = (timestamp: Moment) => { + return i18n.translate('xpack.uptime.monitorList.statusColumn.checkedTimestamp', { + defaultMessage: 'Checked {timestamp}', + values: { timestamp: getShortTimeStamp(timestamp) }, + }); +}; + const PaddedText = euiStyled(EuiText)` padding-right: ${(props) => props.theme.eui.paddingSizes.xs}; `; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx new file mode 100644 index 0000000000000..c0453573693c4 --- /dev/null +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx @@ -0,0 +1,89 @@ +/* + * 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 { EuiBadge, EuiProgress } from '@elastic/eui'; +import React, { useEffect, useState } from 'react'; +import { useBrowserRunOnceMonitors } from '../../../../monitor_management/test_now_mode/browser/use_browser_run_once_monitors'; +import { + IN_PROGRESS_LABEL, + PENDING_LABEL, +} from '../../../../monitor_management/test_now_mode/test_result_header'; + +export const BrowserMonitorProgress = ({ + configId, + testRunId, + duration, + isUpdating, + updateMonitorStatus, +}: { + configId: string; + testRunId: string; + duration: number; + isUpdating: boolean; + updateMonitorStatus: () => void; +}) => { + const { journeyStarted, summaryDoc, data } = useBrowserRunOnceMonitors({ + configId, + testRunId, + refresh: false, + skipDetails: true, + }); + + const [startTime, setStartTime] = useState(Date.now()); + const [passedTime, setPassedTime] = useState(0); + + useEffect(() => { + if (summaryDoc) { + updateMonitorStatus(); + } + }, [updateMonitorStatus, summaryDoc]); + + useEffect(() => { + const interVal = setInterval(() => { + if (journeyStarted) { + setPassedTime((Date.now() - startTime) * 1000); + } + }, 500); + const startTimeValue = startTime; + return () => { + if ((Date.now() - startTimeValue) * 1000 > duration) { + clearInterval(interVal); + } + }; + }, [data, duration, journeyStarted, startTime]); + + useEffect(() => { + if (journeyStarted) { + setStartTime(Date.now()); + } + }, [journeyStarted]); + + if (isUpdating || passedTime > duration) { + return ( + <> + {IN_PROGRESS_LABEL} + + + ); + } + + return ( + + {journeyStarted ? ( + <> + {IN_PROGRESS_LABEL} + + + ) : ( + <> + {PENDING_LABEL} + + + )} + + ); +}; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx new file mode 100644 index 0000000000000..e4fc0cf90e87b --- /dev/null +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx @@ -0,0 +1,61 @@ +/* + * 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 React, { useEffect } from 'react'; +import { useSelector } from 'react-redux'; +import { SimpleMonitorProgress } from './simple_monitor_progress'; +import { BrowserMonitorProgress } from './browser_monitor_progress'; +import { DataStream } from '../../../../../../common/runtime_types'; +import { useUpdatedMonitor } from './use_updated_monitor'; +import { refreshedMonitorSelector } from '../../../../../state/reducers/monitor_list'; + +export const MonitorProgress = ({ + monitorId, + configId, + testRunId, + duration, + monitorType, + stopProgressTrack, +}: { + monitorId: string; + configId: string; + testRunId: string; + duration: number; + monitorType: DataStream; + stopProgressTrack: () => void; +}) => { + const { updateMonitorStatus, isUpdating } = useUpdatedMonitor({ + testRunId, + monitorId, + }); + + const refreshedMonitorId = useSelector(refreshedMonitorSelector); + + useEffect(() => { + if (refreshedMonitorId.includes(monitorId)) { + stopProgressTrack(); + } + }, [isUpdating, monitorId, refreshedMonitorId, stopProgressTrack]); + + return monitorType === 'browser' ? ( + + ) : ( + + ); +}; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx new file mode 100644 index 0000000000000..d51ae3f4e9dff --- /dev/null +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx @@ -0,0 +1,62 @@ +/* + * 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 { EuiBadge, EuiProgress } from '@elastic/eui'; +import React, { useEffect, useRef, useState } from 'react'; +import { useSimpleRunOnceMonitors } from '../../../../monitor_management/test_now_mode/simple/use_simple_run_once_monitors'; +import { IN_PROGRESS_LABEL } from '../../../../monitor_management/test_now_mode/test_result_header'; + +export const SimpleMonitorProgress = ({ + monitorId, + testRunId, + duration, + isUpdating, + updateMonitorStatus, +}: { + monitorId: string; + testRunId: string; + duration: number; + isUpdating: boolean; + updateMonitorStatus: () => void; +}) => { + const { summaryDoc, data } = useSimpleRunOnceMonitors({ + configId: monitorId, + testRunId, + }); + + const startTime = useRef(Date.now()); + + const [passedTime, setPassedTime] = useState(Date.now()); + + useEffect(() => { + if (summaryDoc) { + updateMonitorStatus(); + } + }, [updateMonitorStatus, summaryDoc]); + + useEffect(() => { + setPassedTime(Date.now() - startTime.current); + }, [data]); + + const passedTimeMicro = passedTime * 1000; + + if (isUpdating || passedTimeMicro > duration) { + return ( + <> + {IN_PROGRESS_LABEL} + + + ); + } + + return ( + + {IN_PROGRESS_LABEL} + + + ); +}; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/use_updated_monitor.ts b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/use_updated_monitor.ts new file mode 100644 index 0000000000000..b76971d4079e3 --- /dev/null +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/progress/use_updated_monitor.ts @@ -0,0 +1,44 @@ +/* + * 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 { useCallback } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { getUpdatedMonitor, setUpdatingMonitorId } from '../../../../../state/actions'; +import { isUpdatingMonitorSelector } from '../../../../../state/reducers/monitor_list'; + +export const useUpdatedMonitor = ({ + testRunId, + monitorId, +}: { + testRunId: string; + monitorId: string; +}) => { + const dispatch = useDispatch(); + + const isUpdatingMonitors = useSelector(isUpdatingMonitorSelector); + + const updateMonitorStatus = useCallback(() => { + if (testRunId) { + dispatch( + getUpdatedMonitor.get({ + dateRangeStart: 'now-10m', + dateRangeEnd: 'now', + filters: JSON.stringify({ + bool: { + should: [{ match_phrase: { test_run_id: testRunId } }], + minimum_should_match: 1, + }, + }), + pageSize: 1, + }) + ); + dispatch(setUpdatingMonitorId(monitorId)); + } + }, [dispatch, monitorId, testRunId]); + + return { updateMonitorStatus, isUpdating: isUpdatingMonitors.includes(monitorId) }; +}; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/test_now_col.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/test_now_col.tsx new file mode 100644 index 0000000000000..de32c874ae24c --- /dev/null +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/test_now_col.tsx @@ -0,0 +1,60 @@ +/* + * 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 React from 'react'; +import { i18n } from '@kbn/i18n'; +import { useDispatch, useSelector } from 'react-redux'; +import { EuiButtonIcon, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; +import { testNowMonitorAction } from '../../../../state/actions'; +import { testNowRunSelector } from '../../../../state/reducers/test_now_runs'; + +export const TestNowColumn = ({ + monitorId, + configId, +}: { + monitorId: string; + configId?: string; +}) => { + const dispatch = useDispatch(); + + const testNowRun = useSelector(testNowRunSelector(configId)); + + if (!configId) { + return <>--; + } + + const testNowClick = () => { + dispatch(testNowMonitorAction.get(configId)); + }; + + if (testNowRun && testNowRun.status === 'loading') { + return ; + } + + return ( + + testNowClick()} + isDisabled={Boolean(testNowRun)} + aria-label={TEST_NOW_ARIA_LABEL} + /> + + ); +}; + +export const TEST_NOW_ARIA_LABEL = i18n.translate('xpack.uptime.monitorList.testNow.AriaLabel', { + defaultMessage: 'CLick to run test now', +}); + +export const TEST_NOW_LABEL = i18n.translate('xpack.uptime.monitorList.testNow.label', { + defaultMessage: 'Test now', +}); + +export const TEST_SCHEDULED_LABEL = i18n.translate('xpack.uptime.monitorList.testNow.scheduled', { + defaultMessage: 'Test is already scheduled', +}); diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx index de077931167c1..0eafd3c2fd52a 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx @@ -16,7 +16,6 @@ import { MonitorSummary, } from '../../../../common/runtime_types'; import { MonitorListComponent, noItemsMessage } from './monitor_list'; -import * as redux from 'react-redux'; import moment from 'moment'; import { IHttpFetchError, ResponseErrorBody } from '../../../../../../../src/core/public'; import { mockMoment } from '../../../lib/helper/test_helpers'; @@ -56,7 +55,7 @@ const testFooPings: Ping[] = [ const testFooSummary: MonitorSummary = { monitor_id: 'foo', state: { - monitor: { type: 'http' }, + monitor: { type: 'http', duration: { us: 1000 } }, summaryPings: testFooPings, summary: { up: 1, @@ -91,7 +90,7 @@ const testBarPings: Ping[] = [ const testBarSummary: MonitorSummary = { monitor_id: 'bar', state: { - monitor: { type: 'http' }, + monitor: { type: 'http', duration: { us: 1000 } }, summaryPings: testBarPings, summary: { up: 2, @@ -129,12 +128,6 @@ describe('MonitorList component', () => { }; beforeEach(() => { - const useDispatchSpy = jest.spyOn(redux, 'useDispatch'); - useDispatchSpy.mockReturnValue(jest.fn()); - - const useSelectorSpy = jest.spyOn(redux, 'useSelector'); - useSelectorSpy.mockReturnValue(true); - localStorageMock = { getItem: jest.fn().mockImplementation(() => '25'), setItem: jest.fn(), @@ -156,6 +149,7 @@ describe('MonitorList component', () => { }} pageSize={10} setPageSize={jest.fn()} + refreshedMonitorIds={[]} /> ); expect(await findByText(NO_DATA_MESSAGE)).toBeInTheDocument(); @@ -170,6 +164,7 @@ describe('MonitorList component', () => { }} pageSize={10} setPageSize={jest.fn()} + refreshedMonitorIds={[]} /> ); @@ -190,6 +185,7 @@ describe('MonitorList component', () => { }} pageSize={10} setPageSize={jest.fn()} + refreshedMonitorIds={[]} /> ); @@ -226,6 +222,7 @@ describe('MonitorList component', () => { }} pageSize={10} setPageSize={jest.fn()} + refreshedMonitorIds={[]} /> ); @@ -254,6 +251,7 @@ describe('MonitorList component', () => { }} pageSize={10} setPageSize={jest.fn()} + refreshedMonitorIds={[]} /> ); @@ -283,6 +281,7 @@ describe('MonitorList component', () => { }} pageSize={10} setPageSize={jest.fn()} + refreshedMonitorIds={[]} /> ); diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx index fd9c072b9004f..2dd4ed7bed481 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx @@ -32,15 +32,19 @@ import { CertStatusColumn } from './columns/cert_status_column'; import { MonitorListHeader } from './monitor_list_header'; import { TAGS_LABEL, URL_LABEL } from '../../common/translations'; import { EnableMonitorAlert } from './columns/enable_alert'; -import { STATUS_ALERT_COLUMN } from './translations'; +import { STATUS_ALERT_COLUMN, TEST_NOW_COLUMN } from './translations'; import { MonitorNameColumn } from './columns/monitor_name_col'; import { MonitorTags } from '../../common/monitor_tags'; import { useMonitorHistogram } from './use_monitor_histogram'; +import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; +import { TestNowColumn } from './columns/test_now_col'; +import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; interface Props extends MonitorListProps { pageSize: number; setPageSize: (val: number) => void; monitorList: MonitorList; + refreshedMonitorIds: string[]; } export const noItemsMessage = (loading: boolean, filters?: string) => { @@ -52,8 +56,15 @@ export const MonitorListComponent: ({ filters, monitorList: { list, error, loading }, pageSize, + refreshedMonitorIds, setPageSize, -}: Props) => any = ({ filters, monitorList: { list, error, loading }, pageSize, setPageSize }) => { +}: Props) => any = ({ + filters, + refreshedMonitorIds = [], + monitorList: { list, error, loading }, + pageSize, + setPageSize, +}) => { const [expandedDrawerIds, updateExpandedDrawerIds] = useState([]); const { width } = useWindowSize(); const [hideExtraColumns, setHideExtraColumns] = useState(false); @@ -94,6 +105,8 @@ export const MonitorListComponent: ({ }, {}); }; + const { config } = useUptimeSettingsContext(); + const columns = [ ...[ { @@ -103,12 +116,27 @@ export const MonitorListComponent: ({ mobileOptions: { fullWidth: true, }, - render: (status: string, { state: { timestamp, summaryPings } }: MonitorSummary) => { + render: ( + status: string, + { + monitor_id: monitorId, + state: { + timestamp, + summaryPings, + monitor: { type, duration }, + }, + configId, + }: MonitorSummary + ) => { return ( ); }, @@ -166,20 +194,31 @@ export const MonitorListComponent: ({ }, ] : []), - ...[ - { - align: 'center' as const, - field: '', - name: STATUS_ALERT_COLUMN, - width: '100px', - render: (item: MonitorSummary) => ( - - ), - }, - ], + { + align: 'center' as const, + field: '', + name: STATUS_ALERT_COLUMN, + width: '100px', + render: (item: MonitorSummary) => ( + + ), + }, + ...(config.ui?.monitorManagement?.enabled + ? [ + { + align: 'center' as const, + field: '', + name: TEST_NOW_COLUMN, + width: '100px', + render: (item: MonitorSummary) => ( + + ), + }, + ] + : []), ...(!hideExtraColumns ? [ { @@ -205,7 +244,7 @@ export const MonitorListComponent: ({ ]; return ( - + toggleDrawer(monitorId), 'aria-label': labels.getExpandDrawerLabel(monitorId), }) - : undefined + : ({ monitor_id: monitorId }) => ({ + className: refreshedMonitorIds.includes(monitorId) ? 'refresh-row' : undefined, + }) } /> @@ -253,6 +294,17 @@ export const MonitorListComponent: ({
- + ); }; + +const WrapperPanel = euiStyled(EuiPanel)` + &&& { + .refresh-row{ + background-color: #f0f4fb; + -webkit-transition: background-color 3000ms linear; + -ms-transition: background-color 3000ms linear; + transition: background-color 3000ms linear; + } + } +`; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx index e753d07f9db39..d01f9365a7ac0 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx @@ -7,7 +7,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { getMonitorList } from '../../../state/actions'; +import { clearRefreshedMonitorId, getMonitorList } from '../../../state/actions'; import { esKuerySelector, monitorListSelector } from '../../../state/selectors'; import { MonitorListComponent } from './monitor_list'; import { useUrlParams } from '../../../hooks'; @@ -15,6 +15,7 @@ import { UptimeRefreshContext } from '../../../contexts'; import { getConnectorsAction, getMonitorAlertsAction } from '../../../state/alerts/alerts'; import { useMappingCheck } from '../../../hooks/use_mapping_check'; import { useOverviewFilterCheck } from '../../../hooks/use_overview_filter_check'; +import { refreshedMonitorSelector } from '../../../state/reducers/monitor_list'; export interface MonitorListProps { filters?: string; @@ -43,6 +44,8 @@ export const MonitorList: React.FC = (props) => { const { lastRefresh } = useContext(UptimeRefreshContext); + const refreshedMonitorIds = useSelector(refreshedMonitorSelector); + const monitorList = useSelector(monitorListSelector); useMappingCheck(monitorList.error); @@ -81,12 +84,23 @@ export const MonitorList: React.FC = (props) => { dispatch(getConnectorsAction.get()); }, [dispatch]); + useEffect(() => { + if (refreshedMonitorIds) { + refreshedMonitorIds.forEach((id) => { + setTimeout(() => { + dispatch(clearRefreshedMonitorId(id)); + }, 5 * 1000); + }); + } + }, [dispatch, refreshedMonitorIds]); + return ( ); }; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/translations.ts b/x-pack/plugins/uptime/public/components/overview/monitor_list/translations.ts index fdb50bc295dda..ba006884a42cb 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/translations.ts +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/translations.ts @@ -73,3 +73,7 @@ export const RESPONSE_ANOMALY_SCORE = i18n.translate( export const STATUS_ALERT_COLUMN = i18n.translate('xpack.uptime.monitorList.statusAlert.label', { defaultMessage: 'Status alert', }); + +export const TEST_NOW_COLUMN = i18n.translate('xpack.uptime.monitorList.testNow.label', { + defaultMessage: 'Test now', +}); diff --git a/x-pack/plugins/uptime/public/lib/__mocks__/uptime_store.mock.ts b/x-pack/plugins/uptime/public/lib/__mocks__/uptime_store.mock.ts index 9593a84f08dad..bc09ef0514ef3 100644 --- a/x-pack/plugins/uptime/public/lib/__mocks__/uptime_store.mock.ts +++ b/x-pack/plugins/uptime/public/lib/__mocks__/uptime_store.mock.ts @@ -59,6 +59,7 @@ export const mockState: AppState = { summaries: [], }, loading: false, + refreshedMonitorIds: [], }, monitorManagementList: { list: { @@ -115,4 +116,7 @@ export const mockState: AppState = { cacheSize: 0, hitCount: [], }, + testNowRuns: { + testNowRuns: [], + }, }; diff --git a/x-pack/plugins/uptime/public/state/actions/monitor_list.ts b/x-pack/plugins/uptime/public/state/actions/monitor_list.ts index a85c0004545e4..b86853dcfbefe 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor_list.ts @@ -7,9 +7,25 @@ import { createAction } from 'redux-actions'; import { FetchMonitorStatesQueryArgs, MonitorSummariesResult } from '../../../common/runtime_types'; +import { createAsyncAction } from './utils'; +import { TestNowResponse } from '../api'; export const getMonitorList = createAction('GET_MONITOR_LIST'); export const getMonitorListSuccess = createAction( 'GET_MONITOR_LIST_SUCCESS' ); export const getMonitorListFailure = createAction('GET_MONITOR_LIST_FAIL'); + +export const setUpdatingMonitorId = createAction('SET_UPDATING_MONITOR_ID'); +export const clearRefreshedMonitorId = createAction('CLEAR_REFRESH_MONITOR_ID'); + +export const testNowMonitorAction = createAsyncAction( + 'TEST_NOW_MONITOR_ACTION' +); + +export const clearTestNowMonitorAction = createAction('CLEAR_TEST_NOW_MONITOR_ACTION'); + +export const getUpdatedMonitor = createAsyncAction< + FetchMonitorStatesQueryArgs, + MonitorSummariesResult +>('GET_UPDATED_MONITOR'); diff --git a/x-pack/plugins/uptime/public/state/api/monitor_management.ts b/x-pack/plugins/uptime/public/state/api/monitor_management.ts index 06a49df596d13..ec2806907baa1 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_management.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_management.ts @@ -67,3 +67,13 @@ export const runOnceMonitor = async ({ }): Promise<{ errors: Array<{ error: Error }> }> => { return await apiService.post(API_URLS.RUN_ONCE_MONITOR + `/${id}`, monitor); }; + +export interface TestNowResponse { + errors?: Array<{ error: Error }>; + testRunId: string; + monitorId: string; +} + +export const testNowMonitor = async (configId: string): Promise => { + return await apiService.get(API_URLS.TRIGGER_MONITOR + `/${configId}`); +}; diff --git a/x-pack/plugins/uptime/public/state/effects/index.ts b/x-pack/plugins/uptime/public/state/effects/index.ts index b1a51c5df096c..07b04f8c27c3d 100644 --- a/x-pack/plugins/uptime/public/state/effects/index.ts +++ b/x-pack/plugins/uptime/public/state/effects/index.ts @@ -7,7 +7,11 @@ import { fork } from 'redux-saga/effects'; import { fetchMonitorDetailsEffect } from './monitor'; -import { fetchMonitorListEffect } from './monitor_list'; +import { + fetchMonitorListEffect, + fetchRunNowMonitorEffect, + fetchUpdatedMonitorEffect, +} from './monitor_list'; import { fetchMonitorManagementEffect } from './monitor_management'; import { fetchMonitorStatusEffect } from './monitor_status'; import { fetchDynamicSettingsEffect, setDynamicSettingsEffect } from './dynamic_settings'; @@ -27,6 +31,7 @@ import { export function* rootEffect() { yield fork(fetchMonitorDetailsEffect); yield fork(fetchMonitorListEffect); + yield fork(fetchUpdatedMonitorEffect); yield fork(fetchMonitorManagementEffect); yield fork(fetchMonitorStatusEffect); yield fork(fetchDynamicSettingsEffect); @@ -42,4 +47,5 @@ export function* rootEffect() { yield fork(fetchScreenshotBlocks); yield fork(generateBlockStatsOnPut); yield fork(pruneBlockCache); + yield fork(fetchRunNowMonitorEffect); } diff --git a/x-pack/plugins/uptime/public/state/effects/monitor_list.ts b/x-pack/plugins/uptime/public/state/effects/monitor_list.ts index 154d32ca47a7e..35322c3768190 100644 --- a/x-pack/plugins/uptime/public/state/effects/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/effects/monitor_list.ts @@ -5,9 +5,15 @@ * 2.0. */ -import { takeLatest } from 'redux-saga/effects'; -import { getMonitorList, getMonitorListSuccess, getMonitorListFailure } from '../actions'; -import { fetchMonitorList } from '../api'; +import { takeEvery, takeLatest } from 'redux-saga/effects'; +import { + getMonitorList, + getMonitorListSuccess, + getMonitorListFailure, + getUpdatedMonitor, + testNowMonitorAction, +} from '../actions'; +import { fetchMonitorList, testNowMonitor } from '../api'; import { fetchEffectFactory } from './fetch_effect'; export function* fetchMonitorListEffect() { @@ -16,3 +22,17 @@ export function* fetchMonitorListEffect() { fetchEffectFactory(fetchMonitorList, getMonitorListSuccess, getMonitorListFailure) ); } + +export function* fetchUpdatedMonitorEffect() { + yield takeLatest( + getUpdatedMonitor.get, + fetchEffectFactory(fetchMonitorList, getUpdatedMonitor.success, getUpdatedMonitor.fail) + ); +} + +export function* fetchRunNowMonitorEffect() { + yield takeEvery( + testNowMonitorAction.get, + fetchEffectFactory(testNowMonitor, testNowMonitorAction.success, testNowMonitorAction.fail) + ); +} diff --git a/x-pack/plugins/uptime/public/state/reducers/index.ts b/x-pack/plugins/uptime/public/state/reducers/index.ts index 0142d271159ce..2b6986c88b746 100644 --- a/x-pack/plugins/uptime/public/state/reducers/index.ts +++ b/x-pack/plugins/uptime/public/state/reducers/index.ts @@ -23,6 +23,7 @@ import { journeyReducer } from './journey'; import { networkEventsReducer } from './network_events'; import { syntheticsReducer } from './synthetics'; import { monitorManagementListReducer } from './monitor_management'; +import { testNowRunsReducer } from './test_now_runs'; export const rootReducer = combineReducers({ monitor: monitorReducer, @@ -42,4 +43,5 @@ export const rootReducer = combineReducers({ journeys: journeyReducer, networkEvents: networkEventsReducer, synthetics: syntheticsReducer, + testNowRuns: testNowRunsReducer, }); diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts b/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts index 2e833bd033c46..8083b50367fe7 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts @@ -7,13 +7,24 @@ import { handleActions, Action } from 'redux-actions'; import { IHttpFetchError, ResponseErrorBody } from 'src/core/public'; -import { getMonitorList, getMonitorListSuccess, getMonitorListFailure } from '../actions'; +import { + getMonitorList, + getMonitorListSuccess, + getMonitorListFailure, + getUpdatedMonitor, + clearRefreshedMonitorId, + setUpdatingMonitorId, +} from '../actions'; import { MonitorSummariesResult } from '../../../common/runtime_types'; +import { AppState } from '../index'; +import { TestNowResponse } from '../api'; export interface MonitorList { - error?: IHttpFetchError; loading: boolean; + refreshedMonitorIds?: string[]; + isUpdating?: string[]; list: MonitorSummariesResult; + error?: IHttpFetchError; } export const initialState: MonitorList = { @@ -23,9 +34,13 @@ export const initialState: MonitorList = { summaries: [], }, loading: false, + refreshedMonitorIds: [], }; -type Payload = MonitorSummariesResult & IHttpFetchError; +type Payload = MonitorSummariesResult & + IHttpFetchError & + string & + TestNowResponse; export const monitorListReducer = handleActions( { @@ -50,6 +65,64 @@ export const monitorListReducer = handleActions( error: action.payload, loading: false, }), + [String(setUpdatingMonitorId)]: (state: MonitorList, action: Action) => ({ + ...state, + isUpdating: [...(state.isUpdating ?? []), action.payload], + }), + [String(getUpdatedMonitor.get)]: (state: MonitorList) => ({ + ...state, + }), + [String(getUpdatedMonitor.success)]: ( + state: MonitorList, + action: Action + ) => { + const summaries = state.list.summaries; + + const newSummary = action.payload.summaries?.[0]; + + if (!newSummary) { + return { ...state, isUpdating: [] }; + } + + return { + ...state, + loading: false, + error: undefined, + isUpdating: state.isUpdating?.filter((item) => item !== newSummary.monitor_id), + refreshedMonitorIds: [...(state.refreshedMonitorIds ?? []), newSummary.monitor_id], + list: { + ...state.list, + summaries: summaries.map((summary) => { + if (summary.monitor_id === newSummary.monitor_id) { + return newSummary; + } + return summary; + }), + }, + }; + }, + [String(getUpdatedMonitor.fail)]: ( + state: MonitorList, + action: Action> + ) => ({ + ...state, + error: action.payload, + loading: false, + isUpdating: [], + }), + [String(clearRefreshedMonitorId)]: (state: MonitorList, action: Action) => ({ + ...state, + refreshedMonitorIds: (state.refreshedMonitorIds ?? []).filter( + (item) => item !== action.payload + ), + }), }, initialState ); + +export const refreshedMonitorSelector = ({ monitorList }: AppState) => { + return monitorList.refreshedMonitorIds ?? []; +}; + +export const isUpdatingMonitorSelector = ({ monitorList }: AppState) => + monitorList.isUpdating ?? []; diff --git a/x-pack/plugins/uptime/public/state/reducers/test_now_runs.ts b/x-pack/plugins/uptime/public/state/reducers/test_now_runs.ts new file mode 100644 index 0000000000000..4b0ce493ba13c --- /dev/null +++ b/x-pack/plugins/uptime/public/state/reducers/test_now_runs.ts @@ -0,0 +1,82 @@ +/* + * 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 { createReducer, PayloadAction } from '@reduxjs/toolkit'; +import { WritableDraft } from 'immer/dist/types/types-external'; +import { clearTestNowMonitorAction, testNowMonitorAction } from '../actions'; +import { TestNowResponse } from '../api'; +import { AppState } from '../index'; + +export enum TestRunStats { + LOADING = 'loading', + IN_PROGRESS = 'in-progress', + COMPLETED = 'completed', +} + +interface TestNowRun { + monitorId: string; + testRunId?: string; + status: TestRunStats; +} + +export interface TestNowRunsState { + testNowRuns: TestNowRun[]; +} + +export const initialState: TestNowRunsState = { + testNowRuns: [], +}; + +export const testNowRunsReducer = createReducer(initialState, (builder) => { + builder + .addCase( + String(testNowMonitorAction.get), + (state: WritableDraft, action: PayloadAction) => ({ + ...state, + testNowRuns: [ + ...state.testNowRuns, + { monitorId: action.payload, status: TestRunStats.LOADING }, + ], + }) + ) + .addCase( + String(testNowMonitorAction.success), + (state: WritableDraft, { payload }: PayloadAction) => ({ + ...state, + testNowRuns: state.testNowRuns.map((tRun) => + tRun.monitorId === payload.monitorId + ? { + monitorId: payload.monitorId, + testRunId: payload.testRunId, + status: TestRunStats.IN_PROGRESS, + } + : tRun + ), + }) + ) + .addCase( + String(testNowMonitorAction.fail), + (state: WritableDraft, action: PayloadAction) => ({ + ...state, + testNowRuns: [...(state.testNowRuns ?? [])], + }) + ) + .addCase( + String(clearTestNowMonitorAction), + (state: WritableDraft, action: PayloadAction) => ({ + ...state, + testNowRuns: state.testNowRuns.filter((tRun) => tRun.monitorId !== action.payload), + }) + ); +}); + +export const testNowRunsSelector = ({ testNowRuns }: AppState) => testNowRuns.testNowRuns; + +export const testNowRunSelector = + (monitorId?: string) => + ({ testNowRuns }: AppState) => + testNowRuns.testNowRuns.find((tRun) => monitorId && monitorId === tRun.monitorId); diff --git a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts index f8357e8066573..5a714fd2514d8 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts @@ -83,11 +83,13 @@ export const summaryPingsToSummary = (summaryPings: Ping[]): MonitorSummary => { const latest = summaryPings[summaryPings.length - 1]; return { monitor_id: latest.monitor.id, + configId: latest.config_id, state: { timestamp: latest.timestamp, monitor: { name: latest.monitor?.name, type: latest.monitor?.type, + duration: latest.monitor?.duration, }, url: latest.url ?? {}, summary: { diff --git a/x-pack/plugins/uptime/server/lib/synthetics_service/synthetics_service.ts b/x-pack/plugins/uptime/server/lib/synthetics_service/synthetics_service.ts index 79164cade9aa4..20f11fe3b8900 100644 --- a/x-pack/plugins/uptime/server/lib/synthetics_service/synthetics_service.ts +++ b/x-pack/plugins/uptime/server/lib/synthetics_service/synthetics_service.ts @@ -179,7 +179,15 @@ export class SyntheticsService { }; } - async pushConfigs(request?: KibanaRequest, configs?: SyntheticsMonitorWithId[]) { + async pushConfigs( + request?: KibanaRequest, + configs?: Array< + SyntheticsMonitorWithId & { + fields_under_root?: boolean; + fields?: { config_id: string }; + } + > + ) { const monitors = this.formatConfigs(configs || (await this.getMonitorConfigs())); if (monitors.length === 0) { this.logger.debug('No monitor found which can be pushed to service.'); @@ -226,6 +234,32 @@ export class SyntheticsService { } } + async triggerConfigs( + request?: KibanaRequest, + configs?: Array< + SyntheticsMonitorWithId & { + fields_under_root?: boolean; + fields?: { config_id: string; test_run_id: string }; + } + > + ) { + const monitors = this.formatConfigs(configs || (await this.getMonitorConfigs())); + if (monitors.length === 0) { + return; + } + const data = { + monitors, + output: await this.getOutput(request), + }; + + try { + return await this.apiClient.runOnce(data); + } catch (e) { + this.logger.error(e); + throw e; + } + } + async deleteConfigs(request: KibanaRequest, configs: SyntheticsMonitorWithId[]) { const data = { monitors: this.formatConfigs(configs), diff --git a/x-pack/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts index 383d999f29cc6..780a67c0941e1 100644 --- a/x-pack/plugins/uptime/server/rest_api/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/index.ts @@ -37,6 +37,7 @@ import { addSyntheticsMonitorRoute } from './synthetics_service/add_monitor'; import { editSyntheticsMonitorRoute } from './synthetics_service/edit_monitor'; import { deleteSyntheticsMonitorRoute } from './synthetics_service/delete_monitor'; import { runOnceSyntheticsMonitorRoute } from './synthetics_service/run_once_monitor'; +import { testNowMonitorRoute } from './synthetics_service/test_now_monitor'; export * from './types'; export { createRouteWithAuth } from './create_route_with_auth'; @@ -69,4 +70,5 @@ export const restApiRoutes: UMRestApiRouteFactory[] = [ editSyntheticsMonitorRoute, deleteSyntheticsMonitorRoute, runOnceSyntheticsMonitorRoute, + testNowMonitorRoute, ]; diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.ts index 1750466b6c3e6..38def648f6e5c 100644 --- a/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.ts +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.ts @@ -38,6 +38,10 @@ export const addSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ { ...newMonitor.attributes, id: newMonitor.id, + fields: { + config_id: newMonitor.id, + }, + fields_under_root: true, }, ]); diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts index a95876d8d3ea6..530716f709f64 100644 --- a/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts @@ -47,6 +47,10 @@ export const editSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ { ...(editMonitor.attributes as SyntheticsMonitor), id: editMonitor.id, + fields: { + config_id: editMonitor.id, + }, + fields_under_root: true, }, ]); diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/test_now_monitor.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/test_now_monitor.ts new file mode 100644 index 0000000000000..2ad270db213fb --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/test_now_monitor.ts @@ -0,0 +1,48 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { v4 as uuidv4 } from 'uuid'; +import { SyntheticsMonitor } from '../../../common/runtime_types'; +import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; +import { syntheticsMonitorType } from '../../lib/saved_objects/synthetics_monitor'; + +export const testNowMonitorRoute: UMRestApiRouteFactory = () => ({ + method: 'GET', + path: API_URLS.TRIGGER_MONITOR + '/{monitorId}', + validate: { + params: schema.object({ + monitorId: schema.string({ minLength: 1, maxLength: 1024 }), + }), + }, + handler: async ({ request, savedObjectsClient, response, server }): Promise => { + const { monitorId } = request.params; + const monitor = await savedObjectsClient.get( + syntheticsMonitorType, + monitorId + ); + + const { syntheticsService } = server; + + const testRunId = uuidv4(); + + const errors = await syntheticsService.triggerConfigs(request, [ + { + ...monitor.attributes, + id: monitorId, + fields_under_root: true, + fields: { config_id: monitorId, test_run_id: testRunId }, + }, + ]); + + if (errors && errors?.length > 0) { + return { errors, testRunId, monitorId }; + } + + return { testRunId, monitorId }; + }, +}); From f84adb73796a0bb349266b730c7312b8f6792390 Mon Sep 17 00:00:00 2001 From: Brandon Kobel Date: Thu, 3 Feb 2022 14:56:40 -0800 Subject: [PATCH 32/34] Adding snapshot tests for the AAD mappings (#124142) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../experimental_rule_field_map.test.ts | 29 +++ .../technical_rule_field_map.test.ts | 233 ++++++++++++++++++ 2 files changed, 262 insertions(+) create mode 100644 x-pack/plugins/rule_registry/common/assets/field_maps/experimental_rule_field_map.test.ts create mode 100644 x-pack/plugins/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts diff --git a/x-pack/plugins/rule_registry/common/assets/field_maps/experimental_rule_field_map.test.ts b/x-pack/plugins/rule_registry/common/assets/field_maps/experimental_rule_field_map.test.ts new file mode 100644 index 0000000000000..d3ed9ff937a0c --- /dev/null +++ b/x-pack/plugins/rule_registry/common/assets/field_maps/experimental_rule_field_map.test.ts @@ -0,0 +1,29 @@ +/* + * 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 { experimentalRuleFieldMap } from './experimental_rule_field_map'; + +// This test purely exists to see what the resultant mappings are and +// make it obvious when some dependency results in the mappings changing +it('matches snapshot', () => { + expect(experimentalRuleFieldMap).toMatchInlineSnapshot(` + Object { + "kibana.alert.evaluation.threshold": Object { + "scaling_factor": 100, + "type": "scaled_float", + }, + "kibana.alert.evaluation.value": Object { + "scaling_factor": 100, + "type": "scaled_float", + }, + "kibana.alert.instance.id": Object { + "required": true, + "type": "keyword", + }, + } + `); +}); diff --git a/x-pack/plugins/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts b/x-pack/plugins/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts new file mode 100644 index 0000000000000..916174f225415 --- /dev/null +++ b/x-pack/plugins/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts @@ -0,0 +1,233 @@ +/* + * 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 { technicalRuleFieldMap } from './technical_rule_field_map'; + +// This test purely exists to see what the resultant mappings are and +// make it obvious when some dependency results in the mappings changing +it('matches snapshot', () => { + expect(technicalRuleFieldMap).toMatchInlineSnapshot(` + Object { + "@timestamp": Object { + "array": false, + "required": true, + "type": "date", + }, + "ecs.version": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "event.action": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "event.kind": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.action_group": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.duration.us": Object { + "type": "long", + }, + "kibana.alert.end": Object { + "type": "date", + }, + "kibana.alert.reason": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.risk_score": Object { + "array": false, + "required": false, + "type": "float", + }, + "kibana.alert.rule.author": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.category": Object { + "array": false, + "required": true, + "type": "keyword", + }, + "kibana.alert.rule.consumer": Object { + "required": true, + "type": "keyword", + }, + "kibana.alert.rule.created_at": Object { + "array": false, + "required": false, + "type": "date", + }, + "kibana.alert.rule.created_by": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.description": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.enabled": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.execution.uuid": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.from": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.interval": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.license": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.name": Object { + "array": false, + "required": true, + "type": "keyword", + }, + "kibana.alert.rule.note": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.parameters": Object { + "ignore_above": 4096, + "type": "flattened", + }, + "kibana.alert.rule.producer": Object { + "required": true, + "type": "keyword", + }, + "kibana.alert.rule.references": Object { + "array": true, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.rule_id": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.rule_name_override": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.rule_type_id": Object { + "required": true, + "type": "keyword", + }, + "kibana.alert.rule.tags": Object { + "array": true, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.to": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.type": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.updated_at": Object { + "array": false, + "required": false, + "type": "date", + }, + "kibana.alert.rule.updated_by": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.rule.uuid": Object { + "array": false, + "required": true, + "type": "keyword", + }, + "kibana.alert.rule.version": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.severity": Object { + "type": "keyword", + }, + "kibana.alert.start": Object { + "type": "date", + }, + "kibana.alert.status": Object { + "required": true, + "type": "keyword", + }, + "kibana.alert.system_status": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.uuid": Object { + "required": true, + "type": "keyword", + }, + "kibana.alert.workflow_reason": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.workflow_status": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.alert.workflow_user": Object { + "array": false, + "required": false, + "type": "keyword", + }, + "kibana.space_ids": Object { + "array": true, + "required": true, + "type": "keyword", + }, + "kibana.version": Object { + "array": false, + "required": false, + "type": "version", + }, + "tags": Object { + "array": true, + "required": false, + "type": "keyword", + }, + } + `); +}); From cc0380a4613b27129a888dde673bd2d412d62b73 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 3 Feb 2022 16:00:38 -0800 Subject: [PATCH 33/34] [ci-stats] send test results to ci-stats service (#123740) * [ci-stats] send test results to ci-stats service * move export to export type --- package.json | 1 + packages/kbn-dev-utils/BUILD.bazel | 2 + .../ci_stats_reporter/ci_stats_reporter.ts | 105 +++++++++--- .../ci_stats_test_group_types.ts | 90 ++++++++++ .../src/ci_stats_reporter/index.ts | 1 + packages/kbn-pm/dist/index.js | 49 +++++- packages/kbn-test/BUILD.bazel | 7 +- packages/kbn-test/jest-preset.js | 6 + .../kbn-test/jest_integration/jest-preset.js | 6 + .../functional_test_runner.ts | 6 +- .../src/functional_test_runner/index.ts | 3 +- .../__fixtures__/failure_hooks/config.js | 1 + .../__fixtures__/simple_project/config.js | 3 + .../lib/config/config.ts | 2 + .../lib/config/schema.ts | 1 + .../lib/failure_metadata.test.ts | 61 ------- .../lib/failure_metadata.ts | 93 ----------- .../src/functional_test_runner/lib/index.ts | 2 +- .../functional_test_runner/lib/lifecycle.ts | 8 + .../mocha/reporter/ci_stats_ftr_reporter.ts | 157 ++++++++++++++++++ .../lib/mocha/reporter/reporter.js | 22 ++- .../lib/test_metadata.ts | 41 +++++ .../functional_test_runner/public_types.ts | 8 +- .../src/jest/ci_stats_jest_reporter.ts | 120 +++++++++++++ packages/kbn-test/src/mocha/index.ts | 2 +- .../functional/services/common/screenshots.ts | 42 ++++- 26 files changed, 629 insertions(+), 210 deletions(-) create mode 100644 packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_test_group_types.ts delete mode 100644 packages/kbn-test/src/functional_test_runner/lib/failure_metadata.test.ts delete mode 100644 packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts create mode 100644 packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts create mode 100644 packages/kbn-test/src/functional_test_runner/lib/test_metadata.ts create mode 100644 packages/kbn-test/src/jest/ci_stats_jest_reporter.ts diff --git a/package.json b/package.json index 860f5ebc57990..83babf74c561d 100644 --- a/package.json +++ b/package.json @@ -455,6 +455,7 @@ "@emotion/babel-preset-css-prop": "^11.2.0", "@emotion/jest": "^11.3.0", "@istanbuljs/schema": "^0.1.2", + "@jest/console": "^26.6.2", "@jest/reporters": "^26.6.2", "@kbn/babel-code-parser": "link:bazel-bin/packages/kbn-babel-code-parser", "@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset", diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel index 7d7ba29871ef0..65e0957fe5d90 100644 --- a/packages/kbn-dev-utils/BUILD.bazel +++ b/packages/kbn-dev-utils/BUILD.bazel @@ -45,6 +45,7 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "//packages/kbn-utils", + "//packages/kbn-std", "@npm//@babel/core", "@npm//axios", "@npm//chalk", @@ -67,6 +68,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-utils:npm_module_types", + "//packages/kbn-std:npm_module_types", "@npm//@babel/parser", "@npm//@babel/types", "@npm//@types/babel__core", diff --git a/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts b/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts index 3dff5acdc228a..f16cdcc80f286 100644 --- a/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts +++ b/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts @@ -11,16 +11,28 @@ import Os from 'os'; import Fs from 'fs'; import Path from 'path'; import crypto from 'crypto'; + import execa from 'execa'; -import Axios from 'axios'; +import Axios, { AxiosRequestConfig } from 'axios'; // @ts-expect-error not "public", but necessary to prevent Jest shimming from breaking things import httpAdapter from 'axios/lib/adapters/http'; import { ToolingLog } from '../tooling_log'; import { parseConfig, Config } from './ci_stats_config'; +import type { CiStatsTestGroupInfo, CiStatsTestRun } from './ci_stats_test_group_types'; const BASE_URL = 'https://ci-stats.kibana.dev'; +/** Container for metadata that can be attached to different ci-stats objects */ +export interface CiStatsMetadata { + /** + * Arbitrary key-value pairs which can be attached to CiStatsTiming and CiStatsMetric + * objects stored in the ci-stats service + */ + [key: string]: string | string[] | number | boolean | undefined; +} + +/** A ci-stats metric record */ export interface CiStatsMetric { /** Top-level categorization for the metric, e.g. "page load bundle size" */ group: string; @@ -40,13 +52,7 @@ export interface CiStatsMetric { meta?: CiStatsMetadata; } -export interface CiStatsMetadata { - /** - * Arbitrary key-value pairs which can be attached to CiStatsTiming and CiStatsMetric - * objects stored in the ci-stats service - */ - [key: string]: string | string[] | number | boolean | undefined; -} +/** A ci-stats timing event */ export interface CiStatsTiming { /** Top-level categorization for the timing, e.g. "scripts/foo", process type, etc. */ group: string; @@ -58,13 +64,7 @@ export interface CiStatsTiming { meta?: CiStatsMetadata; } -interface ReqOptions { - auth: boolean; - path: string; - body: any; - bodyDesc: string; -} - +/** Options for reporting timings to ci-stats */ export interface TimingsOptions { /** list of timings to record */ timings: CiStatsTiming[]; @@ -74,10 +74,41 @@ export interface TimingsOptions { kibanaUuid?: string | null; } +/** Options for reporting metrics to ci-stats */ export interface MetricsOptions { /** Default metadata to add to each metric */ defaultMeta?: CiStatsMetadata; } + +/** Options for reporting tests to ci-stats */ +export interface CiStatsReportTestsOptions { + /** + * Information about the group of tests that were run + */ + group: CiStatsTestGroupInfo; + /** + * Information about each test that ran, including failure information + */ + testRuns: CiStatsTestRun[]; +} + +/* @internal */ +interface ReportTestsResponse { + buildId: string; + groupId: string; + testRunCount: number; +} + +/* @internal */ +interface ReqOptions { + auth: boolean; + path: string; + body: any; + bodyDesc: string; + query?: AxiosRequestConfig['params']; +} + +/** Object that helps report data to the ci-stats service */ export class CiStatsReporter { /** * Create a CiStatsReporter by inspecting the ENV for the necessary config @@ -86,7 +117,7 @@ export class CiStatsReporter { return new CiStatsReporter(parseConfig(log), log); } - constructor(private config: Config | undefined, private log: ToolingLog) {} + constructor(private readonly config: Config | undefined, private readonly log: ToolingLog) {} /** * Determine if CI_STATS is explicitly disabled by the environment. To determine @@ -165,7 +196,7 @@ export class CiStatsReporter { this.log.debug('CIStatsReporter committerHash: %s', defaultMeta.committerHash); - return await this.req({ + return !!(await this.req({ auth: !!buildId, path: '/v1/timings', body: { @@ -175,7 +206,7 @@ export class CiStatsReporter { timings, }, bodyDesc: timings.length === 1 ? `${timings.length} timing` : `${timings.length} timings`, - }); + })); } /** @@ -188,12 +219,11 @@ export class CiStatsReporter { } const buildId = this.config?.buildId; - if (!buildId) { - throw new Error(`CiStatsReporter can't be authorized without a buildId`); + throw new Error(`metrics can't be reported without a buildId`); } - return await this.req({ + return !!(await this.req({ auth: true, path: '/v1/metrics', body: { @@ -204,6 +234,30 @@ export class CiStatsReporter { bodyDesc: `metrics: ${metrics .map(({ group, id, value }) => `[${group}/${id}=${value}]`) .join(' ')}`, + })); + } + + /** + * Send test reports to ci-stats + */ + async reportTests({ group, testRuns }: CiStatsReportTestsOptions) { + if (!this.config?.buildId || !this.config?.apiToken) { + throw new Error( + 'unable to report tests unless buildId is configured and auth config available' + ); + } + + return await this.req({ + auth: true, + path: '/v1/test_group', + query: { + buildId: this.config?.buildId, + }, + bodyDesc: `[${group.name}/${group.type}] test groups with ${testRuns.length} tests`, + body: [ + JSON.stringify({ group }), + ...testRuns.map((testRun) => JSON.stringify({ testRun })), + ].join('\n'), }); } @@ -241,7 +295,7 @@ export class CiStatsReporter { } } - private async req({ auth, body, bodyDesc, path }: ReqOptions) { + private async req({ auth, body, bodyDesc, path, query }: ReqOptions) { let attempt = 0; const maxAttempts = 5; @@ -251,23 +305,24 @@ export class CiStatsReporter { Authorization: `token ${this.config.apiToken}`, }; } else if (auth) { - throw new Error('this.req() shouldnt be called with auth=true if this.config is defined'); + throw new Error('this.req() shouldnt be called with auth=true if this.config is not defined'); } while (true) { attempt += 1; try { - await Axios.request({ + const resp = await Axios.request({ method: 'POST', url: path, baseURL: BASE_URL, headers, data: body, + params: query, adapter: httpAdapter, }); - return true; + return resp.data; } catch (error) { if (!error?.request) { // not an axios error, must be a usage error that we should notify user about diff --git a/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_test_group_types.ts b/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_test_group_types.ts new file mode 100644 index 0000000000000..147d4e19325b2 --- /dev/null +++ b/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_test_group_types.ts @@ -0,0 +1,90 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { CiStatsMetadata } from './ci_stats_reporter'; + +export type CiStatsTestResult = 'fail' | 'pass' | 'skip'; +export type CiStatsTestType = + | 'after all hook' + | 'after each hook' + | 'before all hook' + | 'before each hook' + | 'test'; + +export interface CiStatsTestRun { + /** + * ISO-8601 formatted datetime representing when the tests started running + */ + startTime: string; + /** + * Duration of the tests in milliseconds + */ + durationMs: number; + /** + * A sequence number, this is used to order the tests in a specific test run + */ + seq: number; + /** + * The type of this "test run", usually this is just "test" but when reporting issues in hooks it can be set to the type of hook + */ + type: CiStatsTestType; + /** + * "fail", "pass" or "skip", the result of the tests + */ + result: CiStatsTestResult; + /** + * The list of suite names containing this test, the first being the outermost suite + */ + suites: string[]; + /** + * The name of this specific test run + */ + name: string; + /** + * Relative path from the root of the repo contianing this test + */ + file: string; + /** + * Error message if the test failed + */ + error?: string; + /** + * Debug output/stdout produced by the test + */ + stdout?: string; + /** + * Screenshots captured during the test run + */ + screenshots?: Array<{ + name: string; + base64Png: string; + }>; +} + +export interface CiStatsTestGroupInfo { + /** + * ISO-8601 formatted datetime representing when the group of tests started running + */ + startTime: string; + /** + * The number of miliseconds that the tests ran for + */ + durationMs: number; + /** + * The type of tests run in this group, any value is valid but test groups are groupped by type in the UI so use something consistent + */ + type: string; + /** + * The name of this specific group (within the "type") + */ + name: string; + /** + * Arbitrary metadata associated with this group. We currently look for a ciGroup metadata property for highlighting that when appropriate + */ + meta: CiStatsMetadata; +} diff --git a/packages/kbn-dev-utils/src/ci_stats_reporter/index.ts b/packages/kbn-dev-utils/src/ci_stats_reporter/index.ts index 318a2921517f1..cf80d06613dbf 100644 --- a/packages/kbn-dev-utils/src/ci_stats_reporter/index.ts +++ b/packages/kbn-dev-utils/src/ci_stats_reporter/index.ts @@ -10,3 +10,4 @@ export * from './ci_stats_reporter'; export type { Config } from './ci_stats_config'; export * from './ship_ci_stats_cli'; export { getTimeReporter } from './report_time'; +export * from './ci_stats_test_group_types'; diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index d4105a5edd7a5..d0fe0f269f6fa 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -9049,7 +9049,9 @@ var _ci_stats_config = __webpack_require__(218); */ // @ts-expect-error not "public", but necessary to prevent Jest shimming from breaking things const BASE_URL = 'https://ci-stats.kibana.dev'; +/** Container for metadata that can be attached to different ci-stats objects */ +/** Object that helps report data to the ci-stats service */ class CiStatsReporter { /** * Create a CiStatsReporter by inspecting the ENV for the necessary config @@ -9146,7 +9148,7 @@ class CiStatsReporter { totalMem: _os.default.totalmem() }; this.log.debug('CIStatsReporter committerHash: %s', defaultMeta.committerHash); - return await this.req({ + return !!(await this.req({ auth: !!buildId, path: '/v1/timings', body: { @@ -9156,7 +9158,7 @@ class CiStatsReporter { timings }, bodyDesc: timings.length === 1 ? `${timings.length} timing` : `${timings.length} timings` - }); + })); } /** * Report metrics data to the ci-stats service. If running outside of CI this method @@ -9174,10 +9176,10 @@ class CiStatsReporter { const buildId = (_this$config4 = this.config) === null || _this$config4 === void 0 ? void 0 : _this$config4.buildId; if (!buildId) { - throw new Error(`CiStatsReporter can't be authorized without a buildId`); + throw new Error(`metrics can't be reported without a buildId`); } - return await this.req({ + return !!(await this.req({ auth: true, path: '/v1/metrics', body: { @@ -9190,6 +9192,35 @@ class CiStatsReporter { id, value }) => `[${group}/${id}=${value}]`).join(' ')}` + })); + } + /** + * Send test reports to ci-stats + */ + + + async reportTests({ + group, + testRuns + }) { + var _this$config5, _this$config6, _this$config7; + + if (!((_this$config5 = this.config) !== null && _this$config5 !== void 0 && _this$config5.buildId) || !((_this$config6 = this.config) !== null && _this$config6 !== void 0 && _this$config6.apiToken)) { + throw new Error('unable to report tests unless buildId is configured and auth config available'); + } + + return await this.req({ + auth: true, + path: '/v1/test_group', + query: { + buildId: (_this$config7 = this.config) === null || _this$config7 === void 0 ? void 0 : _this$config7.buildId + }, + bodyDesc: `[${group.name}/${group.type}] test groups with ${testRuns.length} tests`, + body: [JSON.stringify({ + group + }), ...testRuns.map(testRun => JSON.stringify({ + testRun + }))].join('\n') }); } /** @@ -9239,7 +9270,8 @@ class CiStatsReporter { auth, body, bodyDesc, - path + path, + query }) { let attempt = 0; const maxAttempts = 5; @@ -9250,22 +9282,23 @@ class CiStatsReporter { Authorization: `token ${this.config.apiToken}` }; } else if (auth) { - throw new Error('this.req() shouldnt be called with auth=true if this.config is defined'); + throw new Error('this.req() shouldnt be called with auth=true if this.config is not defined'); } while (true) { attempt += 1; try { - await _axios.default.request({ + const resp = await _axios.default.request({ method: 'POST', url: path, baseURL: BASE_URL, headers, data: body, + params: query, adapter: _http.default }); - return true; + return resp.data; } catch (error) { var _error$response; diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index 69addd9e3c4c7..67299f4afdeb7 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -41,8 +41,10 @@ RUNTIME_DEPS = [ "//packages/kbn-std", "//packages/kbn-utils", "@npm//@elastic/elasticsearch", - "@npm//axios", "@npm//@babel/traverse", + "@npm//@jest/console", + "@npm//@jest/reporters", + "@npm//axios", "@npm//chance", "@npm//dedent", "@npm//del", @@ -58,7 +60,6 @@ RUNTIME_DEPS = [ "@npm//jest-cli", "@npm//jest-snapshot", "@npm//jest-styled-components", - "@npm//@jest/reporters", "@npm//joi", "@npm//mustache", "@npm//normalize-path", @@ -81,6 +82,8 @@ TYPES_DEPS = [ "//packages/kbn-std:npm_module_types", "//packages/kbn-utils", "@npm//@elastic/elasticsearch", + "@npm//@jest/console", + "@npm//@jest/reporters", "@npm//axios", "@npm//elastic-apm-node", "@npm//del", diff --git a/packages/kbn-test/jest-preset.js b/packages/kbn-test/jest-preset.js index e2607100babc5..3c9b222e98df5 100644 --- a/packages/kbn-test/jest-preset.js +++ b/packages/kbn-test/jest-preset.js @@ -55,6 +55,12 @@ module.exports = { rootDirectory: '.', }, ], + [ + '@kbn/test/target_node/jest/ci_stats_jest_reporter', + { + testGroupType: 'Jest Unit Tests', + }, + ], ], // The paths to modules that run some code to configure or set up the testing environment before each test diff --git a/packages/kbn-test/jest_integration/jest-preset.js b/packages/kbn-test/jest_integration/jest-preset.js index 7504dec9e7a20..be007262477d3 100644 --- a/packages/kbn-test/jest_integration/jest-preset.js +++ b/packages/kbn-test/jest_integration/jest-preset.js @@ -21,6 +21,12 @@ module.exports = { reporters: [ 'default', ['@kbn/test/target_node/jest/junit_reporter', { reportName: 'Jest Integration Tests' }], + [ + '@kbn/test/target_node/jest/ci_stats_jest_reporter', + { + testGroupType: 'Jest Integration Tests', + }, + ], ], coverageReporters: !!process.env.CI ? [['json', { file: 'jest-integration.json' }]] diff --git a/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts b/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts index ea55a2672d670..85c474c2f1bec 100644 --- a/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts +++ b/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts @@ -13,7 +13,7 @@ import { Suite, Test } from './fake_mocha_types'; import { Lifecycle, LifecyclePhase, - FailureMetadata, + TestMetadata, readConfigFile, ProviderCollection, readProviderSpec, @@ -27,7 +27,7 @@ import { export class FunctionalTestRunner { public readonly lifecycle = new Lifecycle(); - public readonly failureMetadata = new FailureMetadata(this.lifecycle); + public readonly testMetadata = new TestMetadata(this.lifecycle); private closed = false; private readonly esVersion: EsVersion; @@ -181,7 +181,7 @@ export class FunctionalTestRunner { const coreProviders = readProviderSpec('Service', { lifecycle: () => this.lifecycle, log: () => this.log, - failureMetadata: () => this.failureMetadata, + testMetadata: () => this.testMetadata, config: () => config, dockerServers: () => dockerServers, esVersion: () => this.esVersion, diff --git a/packages/kbn-test/src/functional_test_runner/index.ts b/packages/kbn-test/src/functional_test_runner/index.ts index 1718b5f7a4bc5..e67e72fd5801a 100644 --- a/packages/kbn-test/src/functional_test_runner/index.ts +++ b/packages/kbn-test/src/functional_test_runner/index.ts @@ -7,7 +7,8 @@ */ export { FunctionalTestRunner } from './functional_test_runner'; -export { readConfigFile, Config, EsVersion } from './lib'; +export { readConfigFile, Config, EsVersion, Lifecycle, LifecyclePhase } from './lib'; +export type { ScreenshotRecord } from './lib'; export { runFtrCli } from './cli'; export * from './lib/docker_servers'; export * from './public_types'; diff --git a/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js b/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js index 1375e5a3df2fd..6e25e4c073ab0 100644 --- a/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js +++ b/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/failure_hooks/config.js @@ -35,6 +35,7 @@ export default function () { }, mochaReporter: { captureLogOutput: false, + sendToCiStats: false, }, }; } diff --git a/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/simple_project/config.js b/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/simple_project/config.js index 7163058b78523..4c87b53b5753b 100644 --- a/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/simple_project/config.js +++ b/packages/kbn-test/src/functional_test_runner/integration_tests/__fixtures__/simple_project/config.js @@ -10,4 +10,7 @@ import { resolve } from 'path'; export default () => ({ testFiles: [resolve(__dirname, 'tests.js')], + mochaReporter: { + sendToCiStats: false, + }, }); diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/config.ts b/packages/kbn-test/src/functional_test_runner/lib/config/config.ts index 1d4af9c33fb79..d6248b9628e73 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/config.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/config.ts @@ -20,6 +20,7 @@ interface Options { } export class Config { + public readonly path: string; private [$values]: Record; constructor(options: Options) { @@ -29,6 +30,7 @@ export class Config { throw new TypeError('path is a required option'); } + this.path = path; const { error, value } = schema.validate(settings, { abortEarly: false, context: { diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts index a9ceaa643a60f..e51ebc4538343 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts @@ -152,6 +152,7 @@ export const schema = Joi.object() mochaReporter: Joi.object() .keys({ captureLogOutput: Joi.boolean().default(!!process.env.CI), + sendToCiStats: Joi.boolean().default(!!process.env.CI), }) .default(), diff --git a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.test.ts b/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.test.ts deleted file mode 100644 index b40f6a5c83688..0000000000000 --- a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Lifecycle } from './lifecycle'; -import { FailureMetadata } from './failure_metadata'; -import { Test } from '../fake_mocha_types'; - -it('collects metadata for the current test', async () => { - const lifecycle = new Lifecycle(); - const failureMetadata = new FailureMetadata(lifecycle); - - const test1 = {} as Test; - await lifecycle.beforeEachRunnable.trigger(test1); - failureMetadata.add({ foo: 'bar' }); - - expect(failureMetadata.get(test1)).toMatchInlineSnapshot(` - Object { - "foo": "bar", - } - `); - - const test2 = {} as Test; - await lifecycle.beforeEachRunnable.trigger(test2); - failureMetadata.add({ test: 2 }); - - expect(failureMetadata.get(test1)).toMatchInlineSnapshot(` - Object { - "foo": "bar", - } - `); - expect(failureMetadata.get(test2)).toMatchInlineSnapshot(` - Object { - "test": 2, - } - `); -}); - -it('adds messages to the messages state', () => { - const lifecycle = new Lifecycle(); - const failureMetadata = new FailureMetadata(lifecycle); - - const test1 = {} as Test; - lifecycle.beforeEachRunnable.trigger(test1); - failureMetadata.addMessages(['foo', 'bar']); - failureMetadata.addMessages(['baz']); - - expect(failureMetadata.get(test1)).toMatchInlineSnapshot(` - Object { - "messages": Array [ - "foo", - "bar", - "baz", - ], - } - `); -}); diff --git a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts b/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts deleted file mode 100644 index a766c73f4c727..0000000000000 --- a/packages/kbn-test/src/functional_test_runner/lib/failure_metadata.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { REPO_ROOT } from '@kbn/utils'; - -import { Lifecycle } from './lifecycle'; - -interface Metadata { - [key: string]: unknown; -} - -export class FailureMetadata { - // mocha's global types mean we can't import Mocha or it will override the global jest types.............. - private currentRunnable?: any; - private readonly allMetadata = new Map(); - - constructor(lifecycle: Lifecycle) { - if (!process.env.GCS_UPLOAD_PREFIX && process.env.CI) { - throw new Error( - 'GCS_UPLOAD_PREFIX environment variable is not set and must always be set on CI' - ); - } - - lifecycle.beforeEachRunnable.add((runnable) => { - this.currentRunnable = runnable; - }); - } - - add(metadata: Metadata | ((current: Metadata) => Metadata)) { - if (!this.currentRunnable) { - throw new Error('no current runnable to associate metadata with'); - } - - const current = this.allMetadata.get(this.currentRunnable); - this.allMetadata.set(this.currentRunnable, { - ...current, - ...(typeof metadata === 'function' ? metadata(current || {}) : metadata), - }); - } - - addMessages(messages: string[]) { - this.add((current) => ({ - messages: [...(Array.isArray(current.messages) ? current.messages : []), ...messages], - })); - } - - /** - * @param name Name to label the URL with - * @param repoPath absolute path, within the repo, that will be uploaded - */ - addScreenshot(name: string, repoPath: string) { - const prefix = process.env.GCS_UPLOAD_PREFIX; - - if (!prefix) { - return; - } - - const slash = prefix.endsWith('/') ? '' : '/'; - const urlPath = Path.relative(REPO_ROOT, repoPath) - .split(Path.sep) - .map((c) => encodeURIComponent(c)) - .join('/'); - - if (urlPath.startsWith('..')) { - throw new Error( - `Only call addUploadLink() with paths that are within the repo root, received ${repoPath} and repo root is ${REPO_ROOT}` - ); - } - - const url = `https://storage.googleapis.com/${prefix}${slash}${urlPath}`; - const screenshot = { - name, - url, - }; - - this.add((current) => ({ - screenshots: [...(Array.isArray(current.screenshots) ? current.screenshots : []), screenshot], - })); - - return screenshot; - } - - get(runnable: any) { - return this.allMetadata.get(runnable); - } -} diff --git a/packages/kbn-test/src/functional_test_runner/lib/index.ts b/packages/kbn-test/src/functional_test_runner/lib/index.ts index 98b5fec0597e4..e387fd156fe8a 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/index.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/index.ts @@ -12,7 +12,7 @@ export { readConfigFile, Config } from './config'; export { readProviderSpec, ProviderCollection } from './providers'; // @internal export { runTests, setupMocha } from './mocha'; -export { FailureMetadata } from './failure_metadata'; +export * from './test_metadata'; export * from './docker_servers'; export { SuiteTracker } from './suite_tracker'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts b/packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts index 17dcaa8d7447d..e683ec23a8d84 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts @@ -11,15 +11,23 @@ import { LifecyclePhase } from './lifecycle_phase'; import { Suite, Test } from '../fake_mocha_types'; export class Lifecycle { + /** lifecycle phase that will run handlers once before tests execute */ public readonly beforeTests = new LifecyclePhase<[Suite]>({ singular: true, }); + /** lifecycle phase that runs handlers before each runnable (test and hooks) */ public readonly beforeEachRunnable = new LifecyclePhase<[Test]>(); + /** lifecycle phase that runs handlers before each suite */ public readonly beforeTestSuite = new LifecyclePhase<[Suite]>(); + /** lifecycle phase that runs handlers before each test */ public readonly beforeEachTest = new LifecyclePhase<[Test]>(); + /** lifecycle phase that runs handlers after each suite */ public readonly afterTestSuite = new LifecyclePhase<[Suite]>(); + /** lifecycle phase that runs handlers after a test fails */ public readonly testFailure = new LifecyclePhase<[Error, Test]>(); + /** lifecycle phase that runs handlers after a hook fails */ public readonly testHookFailure = new LifecyclePhase<[Error, Test]>(); + /** lifecycle phase that runs handlers at the very end of execution */ public readonly cleanup = new LifecyclePhase<[]>({ singular: true, }); diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts new file mode 100644 index 0000000000000..61eb7eccce430 --- /dev/null +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts @@ -0,0 +1,157 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as Path from 'path'; + +import { REPO_ROOT } from '@kbn/utils'; +import { CiStatsReporter, CiStatsReportTestsOptions, CiStatsTestType } from '@kbn/dev-utils'; + +import { Config } from '../../config'; +import { Runner } from '../../../fake_mocha_types'; +import { TestMetadata, ScreenshotRecord } from '../../test_metadata'; +import { Lifecycle } from '../../lifecycle'; +import { getSnapshotOfRunnableLogs } from '../../../../mocha'; + +interface Suite { + _beforeAll: Runnable[]; + _beforeEach: Runnable[]; + _afterEach: Runnable[]; + _afterAll: Runnable[]; +} + +interface Runnable { + isFailed(): boolean; + isPending(): boolean; + duration?: number; + titlePath(): string[]; + file: string; + title: string; + parent: Suite; + _screenshots?: ScreenshotRecord[]; +} + +function getHookType(hook: Runnable): CiStatsTestType { + if (hook.parent._afterAll.includes(hook)) { + return 'after all hook'; + } + if (hook.parent._afterEach.includes(hook)) { + return 'after each hook'; + } + if (hook.parent._beforeEach.includes(hook)) { + return 'before each hook'; + } + if (hook.parent._beforeAll.includes(hook)) { + return 'before all hook'; + } + + throw new Error(`unable to determine hook type, hook is not owned by it's parent`); +} + +export function setupCiStatsFtrTestGroupReporter({ + config, + lifecycle, + runner, + testMetadata, + reporter, +}: { + config: Config; + lifecycle: Lifecycle; + runner: Runner; + testMetadata: TestMetadata; + reporter: CiStatsReporter; +}) { + let startMs: number | undefined; + runner.on('start', () => { + startMs = Date.now(); + }); + + const start = Date.now(); + const group: CiStatsReportTestsOptions['group'] = { + startTime: new Date(start).toJSON(), + durationMs: 0, + type: config.path.startsWith('x-pack') ? 'X-Pack Functional Tests' : 'Functional Tests', + name: Path.relative(REPO_ROOT, config.path), + meta: { + ciGroup: config.get('suiteTags.include').find((t: string) => t.startsWith('ciGroup')), + tags: [ + ...config.get('suiteTags.include'), + ...config.get('suiteTags.exclude').map((t: string) => `-${t}`), + ].filter((t) => !t.startsWith('ciGroup')), + }, + }; + + const testRuns: CiStatsReportTestsOptions['testRuns'] = []; + function trackRunnable( + runnable: Runnable, + { error, type }: { error?: Error; type: CiStatsTestType } + ) { + testRuns.push({ + startTime: new Date(Date.now() - (runnable.duration ?? 0)).toJSON(), + durationMs: runnable.duration ?? 0, + seq: testRuns.length + 1, + file: Path.relative(REPO_ROOT, runnable.file), + name: runnable.title, + suites: runnable.titlePath().slice(0, -1), + result: runnable.isFailed() ? 'fail' : runnable.isPending() ? 'skip' : 'pass', + type, + error: error?.stack, + stdout: getSnapshotOfRunnableLogs(runnable), + screenshots: testMetadata.getScreenshots(runnable).map((s) => ({ + base64Png: s.base64Png, + name: s.name, + })), + }); + } + + const errors = new Map(); + runner.on('fail', (test: Runnable, error: Error) => { + errors.set(test, error); + }); + + runner.on('hook end', (hook: Runnable) => { + if (hook.isFailed()) { + const error = errors.get(hook); + if (!error) { + throw new Error(`no error recorded for failed hook`); + } + + trackRunnable(hook, { + type: getHookType(hook), + error, + }); + } + }); + + runner.on('test end', (test: Runnable) => { + const error = errors.get(test); + if (test.isFailed() && !error) { + throw new Error('no error recorded for failed test'); + } + + trackRunnable(test, { + type: 'test', + error, + }); + }); + + runner.on('end', () => { + if (!startMs) { + throw new Error('startMs was not defined'); + } + + // update the durationMs + group.durationMs = Date.now() - startMs; + }); + + lifecycle.cleanup.add(async () => { + await reporter.reportTests({ + group, + testRuns, + }); + }); +} diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js index d6045b71bf3a7..84299cba14eaa 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/reporter.js @@ -9,7 +9,7 @@ import { format } from 'util'; import Mocha from 'mocha'; -import { ToolingLogTextWriter } from '@kbn/dev-utils'; +import { ToolingLogTextWriter, CiStatsReporter } from '@kbn/dev-utils'; import moment from 'moment'; import { recordLog, snapshotLogsForRunnable, setupJUnitReportGeneration } from '../../../../mocha'; @@ -17,11 +17,13 @@ import * as colors from './colors'; import * as symbols from './symbols'; import { ms } from './ms'; import { writeEpilogue } from './write_epilogue'; +import { setupCiStatsFtrTestGroupReporter } from './ci_stats_ftr_reporter'; export function MochaReporterProvider({ getService }) { const log = getService('log'); const config = getService('config'); - const failureMetadata = getService('failureMetadata'); + const lifecycle = getService('lifecycle'); + const testMetadata = getService('testMetadata'); let originalLogWriters; let reporterCaptureStartTime; @@ -45,9 +47,23 @@ export function MochaReporterProvider({ getService }) { if (config.get('junit.enabled') && config.get('junit.reportName')) { setupJUnitReportGeneration(runner, { reportName: config.get('junit.reportName'), - getTestMetadata: (t) => failureMetadata.get(t), }); } + + if (config.get('mochaReporter.sendToCiStats')) { + const reporter = CiStatsReporter.fromEnv(log); + if (!reporter.hasBuildConfig()) { + log.warning('ci-stats reporter config is not available so test results will not be sent'); + } else { + setupCiStatsFtrTestGroupReporter({ + reporter, + config, + lifecycle, + runner, + testMetadata, + }); + } + } } onStart = () => { diff --git a/packages/kbn-test/src/functional_test_runner/lib/test_metadata.ts b/packages/kbn-test/src/functional_test_runner/lib/test_metadata.ts new file mode 100644 index 0000000000000..5789231f87044 --- /dev/null +++ b/packages/kbn-test/src/functional_test_runner/lib/test_metadata.ts @@ -0,0 +1,41 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Lifecycle } from './lifecycle'; + +export interface ScreenshotRecord { + name: string; + base64Png: string; + baselinePath?: string; + failurePath?: string; +} + +export class TestMetadata { + // mocha's global types mean we can't import Mocha or it will override the global jest types.............. + private currentRunnable?: any; + + constructor(lifecycle: Lifecycle) { + lifecycle.beforeEachRunnable.add((runnable) => { + this.currentRunnable = runnable; + }); + } + + addScreenshot(screenshot: ScreenshotRecord) { + this.currentRunnable._screenshots = (this.currentRunnable._screenshots || []).concat( + screenshot + ); + } + + getScreenshots(test: any): ScreenshotRecord[] { + if (!test || typeof test !== 'object' || !test._screenshots) { + return []; + } + + return test._screenshots.slice(); + } +} diff --git a/packages/kbn-test/src/functional_test_runner/public_types.ts b/packages/kbn-test/src/functional_test_runner/public_types.ts index 6cb6d5adf4b19..426fdda74d313 100644 --- a/packages/kbn-test/src/functional_test_runner/public_types.ts +++ b/packages/kbn-test/src/functional_test_runner/public_types.ts @@ -8,10 +8,10 @@ import type { ToolingLog } from '@kbn/dev-utils'; -import type { Config, Lifecycle, FailureMetadata, DockerServersService, EsVersion } from './lib'; +import type { Config, Lifecycle, TestMetadata, DockerServersService, EsVersion } from './lib'; import type { Test, Suite } from './fake_mocha_types'; -export { Lifecycle, Config, FailureMetadata }; +export { Lifecycle, Config, TestMetadata }; export interface AsyncInstance { /** @@ -57,7 +57,7 @@ export interface GenericFtrProviderContext< * @param serviceName */ hasService( - serviceName: 'config' | 'log' | 'lifecycle' | 'failureMetadata' | 'dockerServers' | 'esVersion' + serviceName: 'config' | 'log' | 'lifecycle' | 'testMetadata' | 'dockerServers' | 'esVersion' ): true; hasService(serviceName: K): serviceName is K; hasService(serviceName: string): serviceName is Extract; @@ -71,7 +71,7 @@ export interface GenericFtrProviderContext< getService(serviceName: 'log'): ToolingLog; getService(serviceName: 'lifecycle'): Lifecycle; getService(serviceName: 'dockerServers'): DockerServersService; - getService(serviceName: 'failureMetadata'): FailureMetadata; + getService(serviceName: 'testMetadata'): TestMetadata; getService(serviceName: 'esVersion'): EsVersion; getService(serviceName: T): ServiceMap[T]; diff --git a/packages/kbn-test/src/jest/ci_stats_jest_reporter.ts b/packages/kbn-test/src/jest/ci_stats_jest_reporter.ts new file mode 100644 index 0000000000000..94675d87a3a24 --- /dev/null +++ b/packages/kbn-test/src/jest/ci_stats_jest_reporter.ts @@ -0,0 +1,120 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as Path from 'path'; + +import getopts from 'getopts'; +import { CiStatsReporter, ToolingLog, CiStatsReportTestsOptions } from '@kbn/dev-utils'; +import type { Config } from '@jest/types'; +import { BaseReporter, Test, TestResult } from '@jest/reporters'; +import { ConsoleBuffer } from '@jest/console'; + +type LogEntry = ConsoleBuffer[0]; + +interface ReporterOptions { + testGroupType: string; +} + +function formatConsoleLine({ type, message, origin }: LogEntry) { + const originLines = origin.split('\n'); + + return `console.${type}: ${message}${originLines[0] ? `\n ${originLines[0]}` : ''}`; +} + +/** + * Jest reporter that reports tests to CI Stats + * @class JestJUnitReporter + */ + +// eslint-disable-next-line import/no-default-export +export default class CiStatsJestReporter extends BaseReporter { + private reporter: CiStatsReporter | undefined; + private readonly testGroupType: string; + private readonly reportName: string; + private readonly rootDir: string; + private startTime: number | undefined; + + private group: CiStatsReportTestsOptions['group'] | undefined; + private readonly testRuns: CiStatsReportTestsOptions['testRuns'] = []; + + constructor(config: Config.GlobalConfig, options: ReporterOptions) { + super(); + + this.rootDir = config.rootDir; + this.testGroupType = options?.testGroupType; + if (!this.testGroupType) { + throw new Error('missing testGroupType reporter option'); + } + + const configArg = getopts(process.argv).config; + if (typeof configArg !== 'string') { + throw new Error('expected to find a single --config arg'); + } + this.reportName = configArg; + } + + async onRunStart() { + const reporter = CiStatsReporter.fromEnv( + new ToolingLog({ + level: 'info', + writeTo: process.stdout, + }) + ); + + if (!reporter.hasBuildConfig()) { + return; + } + + this.startTime = Date.now(); + this.reporter = reporter; + this.group = { + name: this.reportName, + type: this.testGroupType, + startTime: new Date(this.startTime).toJSON(), + meta: {}, + durationMs: 0, + }; + } + + async onTestFileResult(_: Test, testResult: TestResult) { + if (!this.reporter || !this.group) { + return; + } + + let elapsedTime = 0; + for (const t of testResult.testResults) { + const startTime = new Date(testResult.perfStats.start + elapsedTime).toJSON(); + elapsedTime += t.duration ?? 0; + this.testRuns.push({ + startTime, + durationMs: t.duration ?? 0, + seq: this.testRuns.length + 1, + file: Path.relative(this.rootDir, testResult.testFilePath), + name: t.title, + result: t.status === 'failed' ? 'fail' : t.status === 'passed' ? 'pass' : 'skip', + suites: t.ancestorTitles, + type: 'test', + error: t.failureMessages.join('\n\n'), + stdout: testResult.console?.map(formatConsoleLine).join('\n'), + }); + } + } + + async onRunComplete() { + if (!this.reporter || !this.group || !this.testRuns.length || !this.startTime) { + return; + } + + this.group.durationMs = Date.now() - this.startTime; + + await this.reporter.reportTests({ + group: this.group, + testRuns: this.testRuns, + }); + } +} diff --git a/packages/kbn-test/src/mocha/index.ts b/packages/kbn-test/src/mocha/index.ts index 4ada51c7ae013..1be65d60a9842 100644 --- a/packages/kbn-test/src/mocha/index.ts +++ b/packages/kbn-test/src/mocha/index.ts @@ -11,7 +11,7 @@ export { setupJUnitReportGeneration } from './junit_report_generation'; // @ts-ignore not typed yet // @internal -export { recordLog, snapshotLogsForRunnable } from './log_cache'; +export { recordLog, snapshotLogsForRunnable, getSnapshotOfRunnableLogs } from './log_cache'; // @ts-ignore not typed yet // @internal export { escapeCdata } from './xml'; diff --git a/test/functional/services/common/screenshots.ts b/test/functional/services/common/screenshots.ts index 0f2ab8e6edfbe..d5f901300941f 100644 --- a/test/functional/services/common/screenshots.ts +++ b/test/functional/services/common/screenshots.ts @@ -22,7 +22,7 @@ const writeFileAsync = promisify(writeFile); export class ScreenshotsService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly config = this.ctx.getService('config'); - private readonly failureMetadata = this.ctx.getService('failureMetadata'); + private readonly testMetadata = this.ctx.getService('testMetadata'); private readonly browser = this.ctx.getService('browser'); private readonly SESSION_DIRECTORY = resolve(this.config.get('screenshots.directory'), 'session'); @@ -51,11 +51,17 @@ export class ScreenshotsService extends FtrService { async compareAgainstBaseline(name: string, updateBaselines: boolean, el?: WebElementWrapper) { this.log.debug('compareAgainstBaseline'); const sessionPath = resolve(this.SESSION_DIRECTORY, `${name}.png`); - await this.capture(sessionPath, el); - const baselinePath = resolve(this.BASELINE_DIRECTORY, `${name}.png`); const failurePath = resolve(this.FAILURE_DIRECTORY, `${name}.png`); + await this.capture({ + path: sessionPath, + name, + el, + baselinePath, + failurePath, + }); + if (updateBaselines) { this.log.debug('Updating baseline snapshot'); // Make the directory if it doesn't exist @@ -76,22 +82,42 @@ export class ScreenshotsService extends FtrService { async take(name: string, el?: WebElementWrapper, subDirectories: string[] = []) { const path = resolve(this.SESSION_DIRECTORY, ...subDirectories, `${name}.png`); - await this.capture(path, el); - this.failureMetadata.addScreenshot(name, path); + await this.capture({ path, name, el }); } async takeForFailure(name: string, el?: WebElementWrapper) { const path = resolve(this.FAILURE_DIRECTORY, `${name}.png`); - await this.capture(path, el); - this.failureMetadata.addScreenshot(`failure[${name}]`, path); + await this.capture({ + path, + name: `failure[${name}]`, + el, + }); } - private async capture(path: string, el?: WebElementWrapper) { + private async capture({ + path, + el, + name, + baselinePath, + failurePath, + }: { + path: string; + name: string; + el?: WebElementWrapper; + baselinePath?: string; + failurePath?: string; + }) { try { this.log.info(`Taking screenshot "${path}"`); const screenshot = await (el ? el.takeScreenshot() : this.browser.takeScreenshot()); await mkdirAsync(dirname(path), { recursive: true }); await writeFileAsync(path, screenshot, 'base64'); + this.testMetadata.addScreenshot({ + name, + base64Png: Buffer.isBuffer(screenshot) ? screenshot.toString('base64') : screenshot, + baselinePath, + failurePath, + }); } catch (err) { this.log.error('SCREENSHOT FAILED'); this.log.error(err); From a5b4b822ce9abfb0b7976cc6ce09aa6cb060c8de Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 4 Feb 2022 03:27:39 +0000 Subject: [PATCH 34/34] chore(NA): splits types from code on @kbn/test (#124469) * chore(NA): splits types from code on @kbn/test * chore(NA): create new @kbn/test-jest-helpers * chore(NA): move wrong files into @kbn/test * chore(NA): remove @kbn/test/jest references Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- package.json | 3 + packages/BUILD.bazel | 3 + .../elastic-eslint-config-kibana/.eslintrc.js | 5 + packages/kbn-es-archiver/BUILD.bazel | 2 +- packages/kbn-i18n/GUIDELINE.md | 2 +- packages/kbn-test-jest-helpers/BUILD.bazel | 182 ++++++++++++++++++ .../jest.config.js} | 6 +- packages/kbn-test-jest-helpers/package.json | 10 + .../src}/enzyme_helpers.tsx | 3 +- .../src}/find_test_subject.ts | 1 + .../src}/index.ts | 2 - .../src}/jsdom_svg_mocks.ts | 0 .../src}/random.ts | 1 + .../src}/redux_helpers.tsx | 0 .../src}/router_helpers.tsx | 0 .../src}/stub_browser_storage.test.ts | 0 .../src}/stub_browser_storage.ts | 0 .../src}/stub_web_worker.ts | 0 .../src}/testbed/README.md | 0 .../src}/testbed/index.ts | 1 + .../src}/testbed/mount_component.tsx | 1 + .../src}/testbed/testbed.ts | 3 +- .../src}/testbed/types.ts | 1 + packages/kbn-test-jest-helpers/tsconfig.json | 16 ++ packages/kbn-test/BUILD.bazel | 29 ++- packages/kbn-test/jest/package.json | 4 - packages/kbn-test/package.json | 1 - packages/kbn-test/src/index.ts | 2 +- .../src/jest/{utils => }/get_url.test.ts | 0 .../kbn-test/src/jest/{utils => }/get_url.ts | 0 .../application/ui/app_container.test.tsx | 2 +- .../chrome/ui/header/collapsible_nav.test.tsx | 2 +- .../public/chrome/ui/header/header.test.tsx | 2 +- .../status/components/status_badge.test.tsx | 2 +- .../status/components/version_header.test.tsx | 2 +- .../fatal_errors/fatal_errors_screen.test.tsx | 2 +- .../notifications/toasts/error_toast.test.tsx | 2 +- .../public/theme/core_theme_provider.test.tsx | 2 +- .../server/preboot/preboot_service.test.ts | 2 +- .../page_footer/page_footer.test.tsx | 2 +- .../page_subtitle/page_subtitle.test.tsx | 2 +- .../page_title/page_title.test.tsx | 2 +- .../management_app/advanced_settings.test.tsx | 2 +- .../components/field/field.test.tsx | 2 +- .../components/form/form.test.tsx | 2 +- .../components/search/search.test.tsx | 2 +- .../components/gauge_component.test.tsx | 2 +- .../components/heatmap_component.test.tsx | 2 +- .../public/utils/get_color_picker.test.tsx | 2 +- .../legacy/console_editor/editor.test.tsx | 2 +- .../library_notification_popover.test.tsx | 2 +- .../embeddable/dashboard_container.test.tsx | 2 +- .../dashboard_empty_screen.test.tsx | 2 +- .../embeddable/grid/dashboard_grid.test.tsx | 2 +- .../viewport/dashboard_viewport.test.tsx | 2 +- .../application/top_nav/clone_modal.test.js | 2 +- .../application/top_nav/save_modal.test.js | 2 +- .../query_string/query_string_manager.test.ts | 2 +- .../state_sync/connect_to_query_state.test.ts | 2 +- .../state_sync/sync_state_with_url.test.ts | 2 +- .../filter_editor/filter_editor.test.tsx | 2 +- .../language_switcher.test.tsx | 2 +- .../no_data_popover.test.tsx | 2 +- .../shard_failure_description.test.tsx | 2 +- .../shard_failure_modal.test.tsx | 2 +- .../shard_failure_open_modal_button.test.tsx | 2 +- .../shard_failure_table.test.tsx | 2 +- .../components/data_view.test.tsx | 2 +- .../empty_index_list_prompt.test.tsx | 2 +- .../empty_index_pattern_prompt.test.tsx | 2 +- .../public/test_utils/test_utils.ts | 6 +- .../field_editor.helpers.ts | 2 +- .../field_editor_flyout_content.helpers.ts | 2 +- .../field_editor_flyout_preview.helpers.ts | 2 +- .../helpers/common_actions.ts | 2 +- .../client_integration/helpers/index.ts | 4 +- .../editors/color/color.test.tsx | 2 +- .../static_lookup/static_lookup.test.tsx | 2 +- .../samples/samples.test.tsx | 2 +- .../public/plugin.test.tsx | 2 +- .../components/action_bar/action_bar.test.tsx | 2 +- .../context_error_message.test.tsx | 2 +- .../application/context/context_app.test.tsx | 2 +- .../context/context_app_content.test.tsx | 2 +- .../application/doc/components/doc.test.tsx | 2 +- .../components/chart/discover_chart.test.tsx | 2 +- .../main/components/chart/histogram.test.tsx | 2 +- .../document_explorere_callout.test.tsx | 2 +- .../hits_counter/hits_counter.test.tsx | 2 +- .../layout/discover_documents.test.tsx | 2 +- .../layout/discover_layout.test.tsx | 2 +- .../loading_spinner/loading_spinner.test.tsx | 2 +- .../components/no_results/no_results.test.tsx | 2 +- .../sidebar/change_indexpattern.test.tsx | 2 +- .../sidebar/discover_field.test.tsx | 2 +- .../sidebar/discover_field_details.test.tsx | 2 +- .../sidebar/discover_field_search.test.tsx | 2 +- .../sidebar/discover_index_pattern.test.tsx | 2 +- ...discover_index_pattern_management.test.tsx | 2 +- .../sidebar/discover_sidebar.test.tsx | 2 +- .../discover_sidebar_responsive.test.tsx | 2 +- .../skip_bottom_button.test.tsx | 2 +- .../top_nav/discover_topnav.test.tsx | 2 +- .../top_nav/open_options_popover.test.tsx | 2 +- .../main/discover_main_app.test.tsx | 2 +- .../discover_grid/discover_grid.test.tsx | 2 +- .../discover_grid_cell_actions.test.tsx | 2 +- .../discover_grid_document_selection.test.tsx | 2 +- .../discover_grid_expand_button.test.tsx | 2 +- .../discover_grid_flyout.test.tsx | 2 +- .../table_header/table_header.test.tsx | 2 +- .../doc_table/components/table_row.test.tsx | 2 +- .../doc_table/doc_table_wrapper.test.tsx | 2 +- .../doc_viewer_source/source.test.tsx | 2 +- .../doc_viewer_table/legacy/table.test.tsx | 2 +- ...saved_search_url_conflict_callout.test.tsx | 2 +- .../public/utils/with_query_params.test.tsx | 2 +- .../embeddable_child_panel.test.tsx | 2 +- .../lib/panel/embeddable_panel.test.tsx | 2 +- .../add_panel/add_panel_flyout.test.tsx | 2 +- .../saved_object_finder_create_new.test.tsx | 2 +- .../customize_panel_action.test.ts | 2 +- .../tests/customize_panel_modal.test.tsx | 2 +- .../cron_editor/cron_editor.test.tsx | 2 +- .../forms/hook_form_lib/shared_imports.ts | 7 +- .../components/add_data/add_data.test.tsx | 2 +- .../manage_data/manage_data.test.tsx | 2 +- .../components/recently_accessed.test.js | 2 +- .../tutorial/instruction_set.test.js | 2 +- .../components/tutorial/introduction.test.js | 2 +- .../tutorial/saved_objects_installer.test.js | 2 +- .../components/tutorial/tutorial.test.js | 2 +- .../components/editor/controls_tab.test.tsx | 2 +- .../editor/list_control_editor.test.tsx | 2 +- .../components/editor/options_tab.test.tsx | 2 +- .../editor/range_control_editor.test.tsx | 2 +- .../components/vis/input_control_vis.test.tsx | 2 +- .../components/vis/list_control.test.tsx | 2 +- .../components/vis/range_control.test.tsx | 2 +- .../public/ui/inspector_panel.test.tsx | 2 +- .../theme/kibana_theme_provider.test.tsx | 2 +- .../server/elasticsearch_service.test.ts | 2 +- .../components/add_data/add_data.test.tsx | 2 +- .../manage_data/manage_data.test.tsx | 2 +- .../components/news_feed/news_feed.test.tsx | 2 +- .../components/overview/overview.test.tsx | 2 +- .../public/code_editor/code_editor.test.tsx | 2 +- .../overview_page_footer.test.tsx | 2 +- .../no_data_page/no_data_page.test.tsx | 2 +- .../table_list_view/table_list_view.test.tsx | 2 +- .../theme/kibana_theme_provider.test.tsx | 2 +- .../url/kbn_url_tracker.test.ts | 2 +- .../state_management/url/url_tracker.test.ts | 2 +- .../public/state_sync/state_sync.test.ts | 2 +- ...eate_session_storage_state_storage.test.ts | 2 +- .../hashed_item_store.test.ts | 2 +- .../public/storage/hashed_item_store/mock.ts | 2 +- .../theme/kibana_theme_provider.test.tsx | 2 +- .../public/top_nav_menu/top_nav_menu.test.tsx | 2 +- .../top_nav_menu/top_nav_menu_item.test.tsx | 2 +- .../saved_object_save_modal.test.tsx | 2 +- .../object_view/components/inspect.test.tsx | 2 +- .../object_view/saved_object_view.test.tsx | 2 +- .../components/delete_confirm_modal.test.tsx | 2 +- .../components/export_modal.test.tsx | 2 +- .../objects_table/components/flyout.test.tsx | 2 +- .../components/import_mode_control.test.tsx | 2 +- .../components/import_summary.test.tsx | 2 +- .../components/overwrite_modal.test.tsx | 2 +- .../components/relationships.test.tsx | 2 +- .../objects_table/components/table.test.tsx | 2 +- .../saved_objects_table.test.tsx | 2 +- .../public/components/opt_in_banner.test.tsx | 2 +- .../public/components/opt_in_message.test.tsx | 2 +- .../opted_in_notice_banner.test.tsx | 2 +- .../components/opt_in_example_flyout.test.tsx | 2 +- .../telemetry_management_section.test.tsx | 4 +- .../number_list/number_list.test.tsx | 2 +- .../components/controls/date_ranges.test.tsx | 2 +- .../controls/palette_picker.test.tsx | 2 +- .../components/controls/percentiles.test.tsx | 2 +- .../public/components/controls/size.test.tsx | 2 +- .../controls/top_aggregate.test.tsx | 2 +- .../options/long_legend_options.test.tsx | 2 +- .../options/percentage_mode.test.tsx | 2 +- .../public/editor/components/heatmap.test.tsx | 2 +- .../pie/public/editor/components/pie.test.tsx | 2 +- .../components/truncate_labels.test.tsx | 2 +- .../components/add_delete_buttons.test.tsx | 2 +- .../components/aggs/agg_select.test.tsx | 2 +- .../components/aggs/filter_ratio.test.js | 2 +- .../components/aggs/histogram_support.test.js | 2 +- .../percentile_rank/multi_value_row.test.tsx | 2 +- .../components/aggs/percentile_ui.test.tsx | 2 +- .../components/color_rules.test.tsx | 2 +- .../components/palette_picker.test.tsx | 2 +- .../panel_config/timeseries.test.tsx | 2 +- .../components/vis_types/gauge/series.test.js | 2 +- .../vis_types/metric/series.test.js | 2 +- .../public/vislib/lib/chart_title.test.js | 2 +- .../vislib/public/vislib/lib/dispatch.test.js | 2 +- .../vislib/public/vislib/lib/handler.test.js | 2 +- .../public/vislib/lib/layout/layout.test.js | 2 +- .../vislib/public/vislib/vis.test.js | 2 +- .../vislib/visualizations/chart.test.js | 2 +- .../vislib/visualizations/gauge_chart.test.js | 2 +- .../vislib/visualizations/pie_chart.test.js | 2 +- .../point_series/heatmap_chart.test.js | 2 +- .../common/truncate_labels.test.tsx | 2 +- .../metrics_axes/value_axes_panel.test.tsx | 2 +- .../point_series/point_series.test.tsx | 2 +- .../xy/public/utils/get_color_picker.test.tsx | 2 +- .../visualize_editor_common.test.tsx | 2 +- .../agg_based_selection.test.tsx | 2 +- .../group_selection/group_selection.test.tsx | 2 +- .../public/wizard/new_vis_modal.test.tsx | 2 +- .../empty_value/empty_value.test.tsx | 2 +- x-pack/plugins/cloud/public/plugin.test.ts | 2 +- .../fixtures/auto_follow_pattern.ts | 2 +- .../fixtures/follower_index.ts | 2 +- .../follower_indices_list.test.js | 2 +- .../auto_follow_pattern_add.helpers.js | 2 +- .../auto_follow_pattern_edit.helpers.js | 2 +- .../auto_follow_pattern_list.helpers.js | 2 +- .../helpers/follower_index_add.helpers.js | 2 +- .../helpers/follower_index_edit.helpers.js | 2 +- .../helpers/follower_index_list.helpers.js | 2 +- .../helpers/home.helpers.js | 2 +- .../client_integration/helpers/index.js | 2 +- ...onnected_search_session_indicator.test.tsx | 2 +- .../components/edit_flyout/overrides.test.js | 2 +- .../analytics/analytics_logic.test.ts | 2 +- .../test_helpers/shared_columns_tests.tsx | 2 +- .../api_logs/api_logs_logic.test.ts | 2 +- .../add_domain/add_domain_logic.test.ts | 2 +- .../automatic_crawl_scheduler_logic.test.ts | 2 +- .../manage_crawls_popover_logic.test.ts | 2 +- .../crawler/crawl_detail_logic.test.ts | 2 +- .../crawler/crawler_domains_logic.test.ts | 2 +- .../components/crawler/crawler_logic.test.ts | 2 +- .../crawler_single_domain_logic.test.ts | 2 +- .../credentials/credentials_logic.test.ts | 2 +- .../components/suggestions_logic.test.tsx | 2 +- .../curations/curation/curation_logic.test.ts | 2 +- .../curations/curations_logic.test.ts | 2 +- .../curation_suggestion_logic.test.ts | 2 +- .../ignored_queries_logic.test.ts | 2 +- .../curations_settings.test.tsx | 2 +- .../curations_settings_logic.test.ts | 2 +- .../document_creation_logic.test.ts | 2 +- .../documents/document_detail_logic.test.ts | 2 +- .../components/engine/engine_logic.test.ts | 2 +- .../engine_creation_logic.test.ts | 2 +- .../engine_overview_logic.test.ts | 2 +- .../components/engines/engines_logic.test.ts | 2 +- .../log_retention/log_retention_logic.test.ts | 2 +- .../meta_engine_creation_logic.test.ts | 2 +- .../relevance_tuning_logic.test.ts | 2 +- .../result_settings_logic.test.ts | 2 +- .../sample_response_logic.test.ts | 2 +- .../role_mappings/role_mappings_logic.test.ts | 2 +- .../sample_engine_creation_cta_logic.test.ts | 2 +- .../reindex_job/reindex_job_logic.test.ts | 2 +- .../schema/schema_base_logic.test.ts | 2 +- .../components/schema/schema_logic.test.ts | 2 +- .../components/search/search_logic.test.ts | 2 +- .../search_ui/search_ui_logic.test.ts | 2 +- .../source_engines_logic.test.ts | 2 +- .../synonyms/synonyms_logic.test.ts | 2 +- .../recursively_fetch_engines/index.test.ts | 2 +- ...dpoint_inline_editable_table_logic.test.ts | 2 +- .../test_helpers/error_handling.ts | 2 +- .../views/api_keys/api_keys_logic.test.ts | 2 +- .../add_source/add_source_logic.test.ts | 2 +- .../display_settings_logic.test.ts | 2 +- .../components/schema/schema_logic.test.ts | 2 +- .../synchronization_logic.test.ts | 2 +- .../views/groups/group_logic.test.ts | 2 +- .../views/groups/groups_logic.test.ts | 2 +- .../oauth_authorize_logic.test.ts | 2 +- .../role_mappings/role_mappings_logic.test.ts | 2 +- .../search_authorize_logic.test.ts | 2 +- .../views/security/security_logic.test.ts | 2 +- .../components/branding_section.test.tsx | 2 +- .../views/settings/settings_logic.test.ts | 2 +- .../agent_enrollment_flyout.test.tsx | 2 +- .../public/services/utils.test.ts | 2 +- .../public/components/search_bar.test.tsx | 2 +- .../components/settings/settings.test.tsx | 2 +- .../client_integration/app/app.helpers.tsx | 2 +- .../edit_policy/features/edit_warning.test.ts | 2 +- .../edit_policy/features/frozen_phase.test.ts | 2 +- .../cloud_aware_behavior.helpers.ts | 2 +- .../form_validation/validation.helpers.ts | 2 +- .../edit_policy/init_test_bed.tsx | 2 +- .../helpers/actions/errors_actions.ts | 2 +- .../helpers/actions/forcemerge_actions.ts | 2 +- .../helpers/actions/form_set_value_action.ts | 2 +- .../helpers/actions/form_toggle_action.ts | 2 +- .../form_toggle_and_set_value_action.ts | 2 +- .../helpers/actions/index_priority_actions.ts | 2 +- .../helpers/actions/min_age_actions.ts | 2 +- .../actions/node_allocation_actions.ts | 2 +- .../helpers/actions/phases.ts | 2 +- .../helpers/actions/readonly_actions.ts | 2 +- .../helpers/actions/replicas_action.ts | 2 +- .../helpers/actions/request_flyout_actions.ts | 2 +- .../helpers/actions/rollover_actions.ts | 2 +- .../helpers/actions/save_policy_action.ts | 2 +- .../actions/searchable_snapshot_actions.ts | 2 +- .../helpers/actions/shrink_actions.ts | 2 +- .../actions/snapshot_policy_actions.ts | 2 +- .../helpers/actions/toggle_phase_action.ts | 2 +- .../__jest__/extend_index_management.test.tsx | 2 +- .../__jest__/policy_table.test.tsx | 2 +- .../client_integration/helpers/index.ts | 4 +- .../home/data_streams_tab.helpers.ts | 7 +- .../client_integration/home/home.helpers.ts | 2 +- .../client_integration/home/home.test.ts | 2 +- .../home/index_templates_tab.helpers.ts | 7 +- .../home/indices_tab.helpers.ts | 7 +- .../home/indices_tab.test.ts | 2 +- .../template_clone.helpers.ts | 2 +- .../template_create.helpers.ts | 2 +- .../template_edit.helpers.ts | 2 +- .../template_form.helpers.ts | 2 +- .../__jest__/components/index_table.test.js | 2 +- .../component_template_create.helpers.ts | 2 +- .../component_template_details.helpers.ts | 2 +- .../component_template_edit.helpers.ts | 2 +- .../component_template_form.helpers.ts | 2 +- .../component_template_list.helpers.ts | 2 +- .../client_integration/helpers/index.ts | 2 +- .../client_integration/helpers/index.ts | 4 +- .../helpers/mappings_editor.helpers.tsx | 2 +- .../load_mappings_provider.test.tsx | 2 +- .../test/fixtures/template.ts | 2 +- .../inventory/components/expression.test.tsx | 2 +- .../components/expression.test.tsx | 2 +- .../components/expression.test.tsx | 2 +- .../components/expression_chart.test.tsx | 2 +- .../components/expression_row.test.tsx | 2 +- .../logs/log_view_configuration.test.tsx | 2 +- .../metric_detail/hooks/metrics_time.test.tsx | 2 +- .../client_integration/helpers/index.ts | 2 +- .../helpers/pipeline_form.helpers.ts | 2 +- .../helpers/pipelines_clone.helpers.ts | 2 +- .../helpers/pipelines_create.helpers.ts | 2 +- .../pipelines_create_from_csv.helpers.ts | 2 +- .../helpers/pipelines_edit.helpers.ts | 2 +- .../helpers/pipelines_list.helpers.ts | 7 +- .../pipeline_processors_editor.helpers.tsx | 2 +- .../__jest__/processors/processor.helpers.tsx | 4 +- .../__jest__/test_pipeline.helpers.tsx | 4 +- .../load_from_json/modal_provider.test.tsx | 2 +- .../components/cell_value.test.tsx | 2 +- .../components/dimension_editor.test.tsx | 2 +- .../components/table_basic.test.tsx | 2 +- .../components/toolbar.test.tsx | 2 +- .../debounced_component.test.tsx | 2 +- .../datapanel.test.tsx | 2 +- .../dimension_panel/dimension_panel.test.tsx | 2 +- .../dimension_panel/reference_editor.test.tsx | 2 +- .../field_item.test.tsx | 2 +- .../fields_accordion.test.tsx | 2 +- .../layerpanel.test.tsx | 2 +- .../dimension_editor.test.tsx | 2 +- .../plugins/lens/public/mocks/store_mocks.tsx | 2 +- .../get_legend_action.test.tsx | 2 +- .../axis_title_settings.test.tsx | 2 +- .../color_ranges/color_ranges.test.tsx | 2 +- .../coloring/palette_configuration.test.tsx | 2 +- .../legend_location_settings.test.tsx | 2 +- .../legend_settings_popover.test.tsx | 2 +- .../value_labels_settings.test.tsx | 2 +- .../toolbar_component/gauge_toolbar.test.tsx | 2 +- .../xy_visualization/expression.test.tsx | 2 +- .../get_legend_action.test.tsx | 2 +- .../axis_settings_popover.test.tsx | 2 +- .../fill_opacity_option.test.tsx | 2 +- .../line_curve_option.test.tsx | 2 +- .../missing_value_option.test.tsx | 2 +- .../visual_options_popover.test.tsx | 2 +- .../xy_config_panel/xy_config_panel.test.tsx | 2 +- .../__jest__/upload_license.test.tsx | 2 +- .../license_management/__jest__/util/util.js | 2 +- .../pipeline_editor/pipeline_editor.test.js | 2 +- .../pipeline_list/add_role_alert.test.js | 2 +- .../pipeline_list/alert_call_out.test.js | 2 +- .../confirm_delete_modal.test.js | 2 +- .../enable_monitoring_alert.test.js | 2 +- .../pipeline_list/pipeline_list.test.js | 2 +- .../pipeline_list/pipelines_table.test.js | 2 +- .../index.test.tsx | 2 +- .../annotations_table.test.js | 2 +- .../anomalies_table/anomaly_details.test.js | 2 +- .../entity_cell/entity_cell.test.tsx | 2 +- .../full_time_range_selector.test.tsx | 2 +- .../rule_editor/actions_section.test.js | 2 +- .../detector_description_list.test.js | 2 +- .../rule_editor/condition_expression.test.js | 2 +- .../rule_editor/conditions_section.test.js | 2 +- .../rule_editor/rule_editor_flyout.test.js | 2 +- .../rule_editor/scope_expression.test.js | 2 +- .../rule_editor/scope_section.test.js | 2 +- .../add_to_filter_list_link.test.js | 2 +- .../delete_rule_modal.test.js | 2 +- .../edit_condition_link.test.js | 2 +- .../rule_action_panel.test.js | 2 +- .../validate_job/validate_job_view.test.js | 2 +- .../use_create_analytics_form.test.tsx | 2 +- .../explorer_chart_distribution.test.js | 2 +- .../explorer_chart_info_tooltip.test.js | 2 +- .../explorer_chart_single_metric.test.js | 2 +- .../edit/calendar_form/calendar_form.test.js | 2 +- .../edit/events_table/events_table.test.js | 2 +- .../edit/import_modal/import_modal.test.js | 2 +- .../imported_events/imported_events.test.js | 2 +- .../calendars/edit/new_calendar.test.js | 2 +- .../new_event_modal/new_event_modal.test.js | 2 +- .../calendars/list/calendars_list.test.js | 2 +- .../settings/calendars/list/header.test.js | 2 +- .../calendars/list/table/table.test.js | 2 +- .../add_item_popover/add_item_popover.test.js | 2 +- .../delete_filter_list_modal.test.js | 2 +- .../edit_description_popover.test.js | 2 +- .../edit/edit_filter_list.test.js | 2 +- .../settings/filter_lists/edit/header.test.js | 2 +- .../filter_lists/edit/toolbar.test.js | 2 +- .../filter_lists/list/filter_lists.test.js | 2 +- .../settings/filter_lists/list/header.test.js | 2 +- .../settings/filter_lists/list/table.test.js | 2 +- .../application/settings/settings.test.tsx | 2 +- .../timeseries_chart/timeseries_chart.test.js | 2 +- .../public/alerts/alert_form.test.tsx | 2 +- .../cluster/overview/helpers.test.js | 2 +- .../elasticsearch/nodes/cells.test.js | 2 +- .../components/no_data/checker_errors.test.js | 2 +- .../collection_enabled.test.js | 2 +- .../collection_interval.test.js | 2 +- .../explanations/exporters/exporters.test.js | 2 +- .../plugin_enabled/plugin_enabled.test.js | 2 +- .../public/components/no_data/no_data.test.js | 2 +- .../no_data/reasons/reason_found.test.js | 2 +- .../no_data/reasons/we_tried.test.js | 2 +- .../page_loading/page_loading.test.js | 2 +- .../summary_status/summary_status.test.js | 2 +- .../add/remote_clusters_add.helpers.tsx | 2 +- .../add/remote_clusters_add.test.ts | 2 +- .../edit/remote_clusters_edit.helpers.tsx | 2 +- .../edit/remote_clusters_edit.test.tsx | 2 +- .../client_integration/helpers/index.ts | 2 +- .../helpers/remote_clusters_actions.ts | 2 +- .../list/remote_clusters_list.helpers.js | 2 +- .../fixtures/remote_cluster.js | 2 +- .../__test__/report_listing.test.helpers.tsx | 2 +- .../reporting_panel_content.test.tsx | 2 +- x-pack/plugins/rollup/fixtures/job.js | 2 +- .../detail_panel/detail_panel.test.js | 2 +- .../sections/job_list/job_list.test.js | 2 +- .../job_list/job_table/job_table.test.js | 2 +- .../test/client_integration/helpers/index.js | 2 +- .../helpers/job_clone.helpers.js | 2 +- .../helpers/job_create.helpers.js | 2 +- .../helpers/job_list.helpers.js | 2 +- .../runtime_fields/public/test_utils.ts | 4 +- .../empty_tree_placeholder.test.tsx | 2 +- .../highlight_details_flyout.test.tsx | 2 +- .../license_warning_notice.test.ts | 2 +- .../profile_loading_placeholder.test.tsx | 2 +- .../editor/editor.test.tsx | 2 +- .../__jest__/profile_tree.test.tsx | 2 +- .../searchprofiler_tabs.test.ts | 2 +- .../account_management_page.test.tsx | 2 +- .../access_agreement_page.test.tsx | 2 +- .../authentication_state_page.test.tsx | 2 +- .../logged_out/logged_out_page.test.tsx | 2 +- .../components/login_form/login_form.test.tsx | 2 +- .../authentication/login/login_page.test.tsx | 2 +- .../overwritten_session_page.test.tsx | 2 +- .../role_combo_box/role_combo_box.test.tsx | 2 +- .../delete_provider/delete_provider.test.tsx | 2 +- .../section_loading/section_loading.test.tsx | 2 +- .../edit_role_mapping_page.test.tsx | 4 +- .../mapping_info_panel.test.tsx | 2 +- .../add_role_template_button.test.tsx | 2 +- .../role_selector/role_selector.test.tsx | 2 +- .../role_template_editor.test.tsx | 2 +- .../add_rule_button.test.tsx | 2 +- .../field_rule_editor.test.tsx | 2 +- .../json_rule_editor.test.tsx | 4 +- .../rule_editor_panel.test.tsx | 4 +- .../rule_group_editor.test.tsx | 2 +- .../visual_rule_editor.test.tsx | 2 +- .../role_mappings_grid_page.test.tsx | 2 +- .../collapsible_panel.test.tsx | 2 +- .../edit_role/delete_role_button.test.tsx | 2 +- .../roles/edit_role/edit_role_page.test.tsx | 2 +- .../privileges/es/cluster_privileges.test.tsx | 2 +- .../es/elasticsearch_privileges.test.tsx | 2 +- .../es/index_privilege_form.test.tsx | 2 +- .../privileges/es/index_privileges.test.tsx | 2 +- .../feature_table/__fixtures__/index.ts | 2 +- .../feature_table/feature_table.test.tsx | 2 +- .../feature_table_expanded_row.test.tsx | 2 +- .../feature_table/sub_feature_form.test.tsx | 2 +- .../feature_table_cell.test.tsx | 2 +- .../privilege_summary/__fixtures__/index.ts | 2 +- .../privilege_summary.test.tsx | 2 +- .../privilege_summary_table.test.tsx | 2 +- .../space_column_header.test.tsx | 2 +- .../privilege_display.test.tsx | 2 +- .../privilege_space_form.test.tsx | 2 +- .../privilege_space_table.test.tsx | 2 +- .../space_aware_privilege_section.test.tsx | 2 +- .../spaces_popover_list.test.tsx | 2 +- .../roles/roles_grid/roles_grid_page.test.tsx | 2 +- .../change_password_form.test.tsx | 2 +- .../confirm_delete_users.test.tsx | 2 +- .../users/users_grid/users_grid_page.test.tsx | 2 +- .../nav_control_component.test.tsx | 2 +- .../nav_control/nav_control_service.test.ts | 2 +- .../security_checkup_service.test.ts | 2 +- .../authorization_service.test.ts | 2 +- .../elasticsearch_service.test.ts | 2 +- .../session_management_service.test.ts | 2 +- .../empty_value/empty_value.test.tsx | 2 +- .../exceptions/error_callout.test.tsx | 2 +- .../viewer/exceptions_utility.test.tsx | 2 +- .../common/components/links/index.test.tsx | 2 +- .../components/ml_popover/ml_popover.test.tsx | 2 +- .../delete_timeline_modal.test.tsx | 2 +- .../delete_timeline_modal/index.test.tsx | 2 +- .../note_previews/index.test.tsx | 2 +- .../open_timeline/open_timeline.test.tsx | 2 +- .../open_timeline_modal_body.test.tsx | 2 +- .../open_timeline/search_row/index.test.tsx | 2 +- .../timelines_table/actions_columns.test.tsx | 2 +- .../timelines_table/common_columns.test.tsx | 2 +- .../timelines_table/extended_columns.test.tsx | 2 +- .../icon_header_columns.test.tsx | 2 +- .../timelines_table/index.test.tsx | 2 +- .../open_timeline/title_row/index.test.tsx | 2 +- .../helpers/home.helpers.ts | 2 +- .../client_integration/helpers/index.ts | 4 +- .../helpers/policy_add.helpers.ts | 2 +- .../helpers/policy_edit.helpers.ts | 2 +- .../helpers/policy_form.helpers.ts | 2 +- .../helpers/repository_add.helpers.ts | 2 +- .../helpers/repository_edit.helpers.ts | 2 +- .../helpers/restore_snapshot.helpers.ts | 2 +- .../helpers/snapshot_list.helpers.ts | 2 +- .../snapshot_restore/test/fixtures/policy.ts | 2 +- .../test/fixtures/repository.ts | 2 +- .../test/fixtures/snapshot.ts | 2 +- .../advanced_settings_subtitle.test.tsx | 2 +- .../advanced_settings_title.test.tsx | 2 +- .../components/copy_mode_control.test.tsx | 2 +- .../copy_to_space_flyout_internal.test.tsx | 2 +- .../components/resolve_all_conflicts.test.tsx | 2 +- .../legacy_url_conflict_internal.test.tsx | 2 +- .../confirm_delete_modal.test.tsx | 2 +- .../unauthorized_prompt.test.tsx | 2 +- .../confirm_alter_active_space_modal.test.tsx | 2 +- .../customize_space/customize_space.test.tsx | 2 +- .../customize_space_avatar.test.tsx | 2 +- .../edit_space/delete_spaces_button.test.tsx | 2 +- .../enabled_features.test.tsx | 2 +- .../edit_space/manage_space_page.test.tsx | 2 +- .../edit_space/reserved_space_badge.test.tsx | 2 +- .../section_panel/section_panel.test.tsx | 2 +- .../spaces_grid/spaces_grid_page.test.tsx | 2 +- .../components/manage_spaces_button.test.tsx | 2 +- .../nav_control/nav_control_popover.test.tsx | 2 +- .../share_to_space_flyout_internal.test.tsx | 2 +- .../space_list/space_list_internal.test.tsx | 2 +- .../space_selector/space_selector.test.tsx | 2 +- .../spaces_manager/spaces_manager.test.ts | 2 +- .../default_space_service.test.ts | 2 +- .../components/index_select_popover.test.tsx | 2 +- .../alert_types/es_query/expression.test.tsx | 2 +- .../alert_types/threshold/expression.test.tsx | 2 +- .../threshold/visualization.test.tsx | 2 +- .../empty_value/empty_value.test.tsx | 2 +- .../components/add_message_variables.test.tsx | 2 +- .../email/email_connector.test.tsx | 2 +- .../email/email_params.test.tsx | 2 +- .../email/exchange_form.test.tsx | 2 +- .../es_index/es_index_connector.test.tsx | 2 +- .../es_index/es_index_params.test.tsx | 2 +- .../jira/jira_connectors.test.tsx | 2 +- .../pagerduty/pagerduty_connectors.test.tsx | 2 +- .../pagerduty/pagerduty_params.test.tsx | 2 +- .../resilient/resilient_connectors.test.tsx | 2 +- .../server_log/server_log_params.test.tsx | 2 +- .../servicenow/servicenow_connectors.test.tsx | 2 +- .../servicenow_itsm_params.test.tsx | 2 +- .../servicenow/servicenow_sir_params.test.tsx | 2 +- .../servicenow/update_connector.test.tsx | 2 +- .../slack/slack_connectors.test.tsx | 2 +- .../slack/slack_params.test.tsx | 2 +- .../swimlane/swimlane_connectors.test.tsx | 2 +- .../swimlane/swimlane_params.test.tsx | 2 +- .../teams/teams_connectors.test.tsx | 2 +- .../teams/teams_params.test.tsx | 2 +- .../webhook/webhook_connectors.test.tsx | 2 +- .../webhook/webhook_params.test.tsx | 2 +- ...son_editor_with_message_variables.test.tsx | 2 +- .../text_area_with_message_variables.test.tsx | 2 +- ...text_field_with_message_variables.test.tsx | 2 +- .../public/application/home.test.tsx | 2 +- .../action_connector_form.test.tsx | 2 +- .../action_form.test.tsx | 2 +- .../action_type_form.test.tsx | 2 +- .../action_type_menu.test.tsx | 2 +- .../connector_add_flyout.test.tsx | 2 +- .../connector_add_modal.test.tsx | 2 +- .../connector_edit_flyout.test.tsx | 2 +- .../connectors_selection.test.tsx | 2 +- .../test_connector_form.test.tsx | 2 +- .../actions_connectors_list.test.tsx | 2 +- .../components/alert_details.test.tsx | 2 +- .../components/alert_details_route.test.tsx | 2 +- .../alert_details/components/alerts.test.tsx | 2 +- .../sections/alert_form/alert_add.test.tsx | 2 +- .../alert_form/alert_conditions.test.tsx | 2 +- .../alert_conditions_group.test.tsx | 2 +- .../sections/alert_form/alert_edit.test.tsx | 2 +- .../sections/alert_form/alert_form.test.tsx | 2 +- .../alert_form/alert_notify_when.test.tsx | 2 +- .../components/alerts_list.test.tsx | 2 +- .../collapsed_item_actions.test.tsx | 2 +- .../components/rule_enabled_switch.test.tsx | 2 +- .../execution_duration_chart.test.tsx | 2 +- .../expression_items/threshold.test.tsx | 2 +- .../common/expression_items/value.test.tsx | 2 +- .../public/custom_time_range_action.test.ts | 2 +- .../public/custom_time_range_badge.test.ts | 2 +- .../client_integration/app/app.helpers.tsx | 2 +- .../es_deprecation_logs.helpers.ts | 2 +- .../es_deprecations.helpers.ts | 2 +- .../kibana_deprecations.helpers.ts | 7 +- .../overview/overview.helpers.ts | 2 +- .../common/charts/chart_empty_state.test.tsx | 2 +- .../common/charts/chart_wrapper.test.tsx | 4 +- .../common/charts/donut_chart.test.tsx | 2 +- .../common/charts/donut_chart_legend.test.tsx | 2 +- .../charts/donut_chart_legend_row.test.tsx | 2 +- .../components/common/location_link.test.tsx | 2 +- .../common/monitor_page_link.test.tsx | 2 +- .../monitor/ml/confirm_delete.test.tsx | 2 +- .../monitor/ping_list/expanded_row.test.tsx | 2 +- .../monitor/ping_list/ping_headers.test.tsx | 2 +- .../availability_reporting/tag_label.test.tsx | 2 +- .../status_by_location.test.tsx | 2 +- .../alerts/alert_field_number.test.tsx | 2 +- .../down_number_select.test.tsx | 2 +- .../time_expression_select.test.tsx | 2 +- .../add_filter_btn.test.tsx | 2 +- .../old_alert_callout.test.tsx | 2 +- .../integration_group.test.tsx | 2 +- .../integration_link.test.tsx | 2 +- .../most_recent_error.test.tsx | 2 +- .../monitor_list_page_size_select.test.tsx | 2 +- .../overview/snapshot/snapshot.test.tsx | 2 +- .../overview/snapshot_heading.test.tsx | 2 +- .../overview/synthetics_callout.test.tsx | 2 +- .../synthetics/console_event.test.tsx | 2 +- .../synthetics/empty_journey.test.tsx | 2 +- .../public/lib/helper/enzyme_helpers.tsx | 2 +- x-pack/plugins/watcher/__fixtures__/watch.ts | 2 +- .../watcher/__fixtures__/watch_history.ts | 2 +- .../client_integration/helpers/index.ts | 4 +- .../helpers/watch_create_json.helpers.ts | 2 +- .../helpers/watch_create_threshold.helpers.ts | 2 +- .../helpers/watch_edit.helpers.ts | 2 +- .../helpers/watch_list.helpers.ts | 7 +- .../helpers/watch_status.helpers.ts | 7 +- .../client_integration/watch_edit.test.ts | 2 +- yarn.lock | 12 ++ 680 files changed, 971 insertions(+), 687 deletions(-) create mode 100644 packages/kbn-test-jest-helpers/BUILD.bazel rename packages/{kbn-test/src/jest/index.ts => kbn-test-jest-helpers/jest.config.js} (74%) create mode 100644 packages/kbn-test-jest-helpers/package.json rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/enzyme_helpers.tsx (98%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/find_test_subject.ts (97%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/index.ts (96%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/jsdom_svg_mocks.ts (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/random.ts (91%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/redux_helpers.tsx (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/router_helpers.tsx (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/stub_browser_storage.test.ts (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/stub_browser_storage.ts (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/stub_web_worker.ts (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/testbed/README.md (100%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/testbed/index.ts (96%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/testbed/mount_component.tsx (97%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/testbed/testbed.ts (98%) rename packages/{kbn-test/src/jest/utils => kbn-test-jest-helpers/src}/testbed/types.ts (99%) create mode 100644 packages/kbn-test-jest-helpers/tsconfig.json delete mode 100644 packages/kbn-test/jest/package.json rename packages/kbn-test/src/jest/{utils => }/get_url.test.ts (100%) rename packages/kbn-test/src/jest/{utils => }/get_url.ts (100%) diff --git a/package.json b/package.json index 83babf74c561d..00df514df765a 100644 --- a/package.json +++ b/package.json @@ -475,6 +475,7 @@ "@kbn/storybook": "link:bazel-bin/packages/kbn-storybook", "@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools", "@kbn/test": "link:bazel-bin/packages/kbn-test", + "@kbn/test-jest-helpers": "link:bazel-bin/packages/kbn-test-jest-helpers", "@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector", "@loaders.gl/polyfills": "^2.3.5", "@mapbox/vector-tile": "1.3.1", @@ -611,6 +612,8 @@ "@types/kbn__std": "link:bazel-bin/packages/kbn-std/npm_module_types", "@types/kbn__storybook": "link:bazel-bin/packages/kbn-storybook/npm_module_types", "@types/kbn__telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types", + "@types/kbn__test": "link:bazel-bin/packages/kbn-test/npm_module_types", + "@types/kbn__test-jest-helpers": "link:bazel-bin/packages/kbn-test-jest-helpers/npm_module_types", "@types/kbn__ui-shared-deps-npm": "link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types", "@types/kbn__ui-shared-deps-src": "link:bazel-bin/packages/kbn-ui-shared-deps-src/npm_module_types", "@types/kbn__ui-theme": "link:bazel-bin/packages/kbn-ui-theme/npm_module_types", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 3b95f652f5bc5..7e6d06922aed2 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -61,6 +61,7 @@ filegroup( "//packages/kbn-storybook:build", "//packages/kbn-telemetry-tools:build", "//packages/kbn-test:build", + "//packages/kbn-test-jest-helpers:build", "//packages/kbn-test-subj-selector:build", "//packages/kbn-timelion-grammar:build", "//packages/kbn-tinymath:build", @@ -126,6 +127,8 @@ filegroup( "//packages/kbn-std:build_types", "//packages/kbn-storybook:build_types", "//packages/kbn-telemetry-tools:build_types", + "//packages/kbn-test:build_types", + "//packages/kbn-test-jest-helpers:build_types", "//packages/kbn-ui-shared-deps-npm:build_types", "//packages/kbn-ui-shared-deps-src:build_types", "//packages/kbn-ui-theme:build_types", diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/elastic-eslint-config-kibana/.eslintrc.js index 8193380d662d8..d27192774e17d 100644 --- a/packages/elastic-eslint-config-kibana/.eslintrc.js +++ b/packages/elastic-eslint-config-kibana/.eslintrc.js @@ -96,6 +96,11 @@ module.exports = { to: false, disallowedMessage: `Use "@kbn/ui-theme" to access theme vars.` })), + { + from: '@kbn/test/jest', + to: '@kbn/test-jest-helpers', + disallowedMessage: `import from @kbn/test-jest-helpers instead` + }, ], ], diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel index 06a0ca02da04a..fed3f248c0995 100644 --- a/packages/kbn-es-archiver/BUILD.bazel +++ b/packages/kbn-es-archiver/BUILD.bazel @@ -45,7 +45,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-test", + "//packages/kbn-test:npm_module_types", "//packages/kbn-utils:npm_module_types", "@npm//@elastic/elasticsearch", "@npm//aggregate-error", diff --git a/packages/kbn-i18n/GUIDELINE.md b/packages/kbn-i18n/GUIDELINE.md index 7ffc4b078c79b..98f6f176d0be8 100644 --- a/packages/kbn-i18n/GUIDELINE.md +++ b/packages/kbn-i18n/GUIDELINE.md @@ -506,7 +506,7 @@ Testing React component that uses the `injectI18n` higher-order component is mor With shallow rendering only top level component is rendered, that is a wrapper itself, not the original component. Since we want to test the rendering of the original component, we need to access it via the wrapper's `WrappedComponent` property. Its value will be the component we passed into `injectI18n()`. -When testing such component, use the `shallowWithIntl` helper function defined in `@kbn/test/jest` and pass the component's `WrappedComponent` property to render the wrapped component. This will shallow render the component with Enzyme and inject the necessary context and props to use the `intl` mock defined in `test_utils/mocks/intl`. +When testing such component, use the `shallowWithIntl` helper function defined in `@kbn/test-jest-helpers` and pass the component's `WrappedComponent` property to render the wrapped component. This will shallow render the component with Enzyme and inject the necessary context and props to use the `intl` mock defined in `test_utils/mocks/intl`. Use the `mountWithIntl` helper function to mount render the component. diff --git a/packages/kbn-test-jest-helpers/BUILD.bazel b/packages/kbn-test-jest-helpers/BUILD.bazel new file mode 100644 index 0000000000000..c713e24592944 --- /dev/null +++ b/packages/kbn-test-jest-helpers/BUILD.bazel @@ -0,0 +1,182 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@npm//@babel/cli:index.bzl", "babel") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_BASE_NAME = "kbn-test-jest-helpers" +PKG_REQUIRE_NAME = "@kbn/test-jest-helpers" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__test-jest-helpers" + +SOURCE_FILES = glob( + [ + "src/**/*" + ], + exclude = [ + "**/*.test.*", + "**/*.snap", + "**/__fixture__/**", + "**/__fixtures__/**", + "**/__snapshots__/**", + ] +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "jest.config.js", + "package.json", +] + +RUNTIME_DEPS = [ + "//packages/kbn-dev-utils", + "//packages/kbn-i18n-react", + "//packages/kbn-std", + "//packages/kbn-utils", + "@npm//@elastic/elasticsearch", + "@npm//axios", + "@npm//@babel/traverse", + "@npm//chance", + "@npm//dedent", + "@npm//del", + "@npm//enzyme", + "@npm//execa", + "@npm//exit-hook", + "@npm//form-data", + "@npm//getopts", + "@npm//globby", + "@npm//he", + "@npm//history", + "@npm//jest", + "@npm//jest-cli", + "@npm//jest-snapshot", + "@npm//jest-styled-components", + "@npm//@jest/reporters", + "@npm//joi", + "@npm//mustache", + "@npm//normalize-path", + "@npm//parse-link-header", + "@npm//prettier", + "@npm//react", + "@npm//react-dom", + "@npm//react-redux", + "@npm//react-router-dom", + "@npm//redux", + "@npm//rxjs", + "@npm//semver", + "@npm//strip-ansi", + "@npm//xmlbuilder", + "@npm//xml2js", +] + +TYPES_DEPS = [ + "//packages/kbn-dev-utils:npm_module_types", + "//packages/kbn-i18n-react:npm_module_types", + "//packages/kbn-std:npm_module_types", + "//packages/kbn-utils:npm_module_types", + "@npm//@elastic/elasticsearch", + "@npm//axios", + "@npm//elastic-apm-node", + "@npm//del", + "@npm//exit-hook", + "@npm//form-data", + "@npm//getopts", + "@npm//jest", + "@npm//jest-cli", + "@npm//jest-snapshot", + "@npm//redux", + "@npm//rxjs", + "@npm//xmlbuilder", + "@npm//@types/chance", + "@npm//@types/dedent", + "@npm//@types/enzyme", + "@npm//@types/he", + "@npm//@types/history", + "@npm//@types/jest", + "@npm//@types/joi", + "@npm//@types/lodash", + "@npm//@types/mustache", + "@npm//@types/normalize-path", + "@npm//@types/node", + "@npm//@types/parse-link-header", + "@npm//@types/prettier", + "@npm//@types/react", + "@npm//@types/react-dom", + "@npm//@types/react-redux", + "@npm//@types/react-router-dom", + "@npm//@types/semver", + "@npm//@types/xml2js", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + source_map = True, + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [ + ":%s" % PKG_BASE_NAME, + ] +) + +filegroup( + name = "build", + srcs = [ + ":npm_module", + ], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-test/src/jest/index.ts b/packages/kbn-test-jest-helpers/jest.config.js similarity index 74% rename from packages/kbn-test/src/jest/index.ts rename to packages/kbn-test-jest-helpers/jest.config.js index a50ff5c59e798..5c5d5c6395999 100644 --- a/packages/kbn-test/src/jest/index.ts +++ b/packages/kbn-test-jest-helpers/jest.config.js @@ -6,4 +6,8 @@ * Side Public License, v 1. */ -export * from './utils'; +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-test-jest-helpers'], +}; diff --git a/packages/kbn-test-jest-helpers/package.json b/packages/kbn-test-jest-helpers/package.json new file mode 100644 index 0000000000000..afab6001d605d --- /dev/null +++ b/packages/kbn-test-jest-helpers/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/test-jest-helpers", + "version": "1.0.0", + "private": true, + "license": "SSPL-1.0 OR Elastic License 2.0", + "main": "./target_node", + "kibana": { + "devOnly": true + } +} diff --git a/packages/kbn-test/src/jest/utils/enzyme_helpers.tsx b/packages/kbn-test-jest-helpers/src/enzyme_helpers.tsx similarity index 98% rename from packages/kbn-test/src/jest/utils/enzyme_helpers.tsx rename to packages/kbn-test-jest-helpers/src/enzyme_helpers.tsx index 696a1d1b63163..222689d621b5d 100644 --- a/packages/kbn-test/src/jest/utils/enzyme_helpers.tsx +++ b/packages/kbn-test-jest-helpers/src/enzyme_helpers.tsx @@ -14,6 +14,7 @@ */ import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n-react'; +// eslint-disable-next-line import/no-extraneous-dependencies import { mount, ReactWrapper, render, shallow } from 'enzyme'; import React, { ReactElement, ValidationMap } from 'react'; import { act as reactAct } from 'react-dom/test-utils'; @@ -118,7 +119,7 @@ export function renderWithIntl( context?: any; childContextTypes?: ValidationMap; } = {} -) { +): any { const options = getOptions(context, childContextTypes, props); return render(nodeWithIntlProp(node), options); diff --git a/packages/kbn-test/src/jest/utils/find_test_subject.ts b/packages/kbn-test-jest-helpers/src/find_test_subject.ts similarity index 97% rename from packages/kbn-test/src/jest/utils/find_test_subject.ts rename to packages/kbn-test-jest-helpers/src/find_test_subject.ts index ef3a744fbd99c..9d519f5197cd7 100644 --- a/packages/kbn-test/src/jest/utils/find_test_subject.ts +++ b/packages/kbn-test-jest-helpers/src/find_test_subject.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +// eslint-disable-next-line import/no-extraneous-dependencies import { ReactWrapper } from 'enzyme'; type Matcher = '=' | '~=' | '|=' | '^=' | '$=' | '*='; diff --git a/packages/kbn-test/src/jest/utils/index.ts b/packages/kbn-test-jest-helpers/src/index.ts similarity index 96% rename from packages/kbn-test/src/jest/utils/index.ts rename to packages/kbn-test-jest-helpers/src/index.ts index a797a801eaf94..3594df854cbe4 100644 --- a/packages/kbn-test/src/jest/utils/index.ts +++ b/packages/kbn-test-jest-helpers/src/index.ts @@ -8,8 +8,6 @@ export * from './enzyme_helpers'; -export * from './get_url'; - export * from './find_test_subject'; export * from './jsdom_svg_mocks'; diff --git a/packages/kbn-test/src/jest/utils/jsdom_svg_mocks.ts b/packages/kbn-test-jest-helpers/src/jsdom_svg_mocks.ts similarity index 100% rename from packages/kbn-test/src/jest/utils/jsdom_svg_mocks.ts rename to packages/kbn-test-jest-helpers/src/jsdom_svg_mocks.ts diff --git a/packages/kbn-test/src/jest/utils/random.ts b/packages/kbn-test-jest-helpers/src/random.ts similarity index 91% rename from packages/kbn-test/src/jest/utils/random.ts rename to packages/kbn-test-jest-helpers/src/random.ts index 4aa8a30555e0c..9f4efccf810f8 100644 --- a/packages/kbn-test/src/jest/utils/random.ts +++ b/packages/kbn-test-jest-helpers/src/random.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +// eslint-disable-next-line import/no-extraneous-dependencies import Chance from 'chance'; const chance = new Chance(); diff --git a/packages/kbn-test/src/jest/utils/redux_helpers.tsx b/packages/kbn-test-jest-helpers/src/redux_helpers.tsx similarity index 100% rename from packages/kbn-test/src/jest/utils/redux_helpers.tsx rename to packages/kbn-test-jest-helpers/src/redux_helpers.tsx diff --git a/packages/kbn-test/src/jest/utils/router_helpers.tsx b/packages/kbn-test-jest-helpers/src/router_helpers.tsx similarity index 100% rename from packages/kbn-test/src/jest/utils/router_helpers.tsx rename to packages/kbn-test-jest-helpers/src/router_helpers.tsx diff --git a/packages/kbn-test/src/jest/utils/stub_browser_storage.test.ts b/packages/kbn-test-jest-helpers/src/stub_browser_storage.test.ts similarity index 100% rename from packages/kbn-test/src/jest/utils/stub_browser_storage.test.ts rename to packages/kbn-test-jest-helpers/src/stub_browser_storage.test.ts diff --git a/packages/kbn-test/src/jest/utils/stub_browser_storage.ts b/packages/kbn-test-jest-helpers/src/stub_browser_storage.ts similarity index 100% rename from packages/kbn-test/src/jest/utils/stub_browser_storage.ts rename to packages/kbn-test-jest-helpers/src/stub_browser_storage.ts diff --git a/packages/kbn-test/src/jest/utils/stub_web_worker.ts b/packages/kbn-test-jest-helpers/src/stub_web_worker.ts similarity index 100% rename from packages/kbn-test/src/jest/utils/stub_web_worker.ts rename to packages/kbn-test-jest-helpers/src/stub_web_worker.ts diff --git a/packages/kbn-test/src/jest/utils/testbed/README.md b/packages/kbn-test-jest-helpers/src/testbed/README.md similarity index 100% rename from packages/kbn-test/src/jest/utils/testbed/README.md rename to packages/kbn-test-jest-helpers/src/testbed/README.md diff --git a/packages/kbn-test/src/jest/utils/testbed/index.ts b/packages/kbn-test-jest-helpers/src/testbed/index.ts similarity index 96% rename from packages/kbn-test/src/jest/utils/testbed/index.ts rename to packages/kbn-test-jest-helpers/src/testbed/index.ts index a283bfc53f4ef..f063f5003fd1c 100644 --- a/packages/kbn-test/src/jest/utils/testbed/index.ts +++ b/packages/kbn-test-jest-helpers/src/testbed/index.ts @@ -14,4 +14,5 @@ export type { SetupFunc, SyncSetupFunc, AsyncSetupFunc, + EuiTableMetaData, } from './types'; diff --git a/packages/kbn-test/src/jest/utils/testbed/mount_component.tsx b/packages/kbn-test-jest-helpers/src/testbed/mount_component.tsx similarity index 97% rename from packages/kbn-test/src/jest/utils/testbed/mount_component.tsx rename to packages/kbn-test-jest-helpers/src/testbed/mount_component.tsx index 2ac482abc0fb2..5c5fd3f2237d1 100644 --- a/packages/kbn-test/src/jest/utils/testbed/mount_component.tsx +++ b/packages/kbn-test-jest-helpers/src/testbed/mount_component.tsx @@ -8,6 +8,7 @@ import React, { ComponentType } from 'react'; import { Store } from 'redux'; +// eslint-disable-next-line import/no-extraneous-dependencies import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; diff --git a/packages/kbn-test/src/jest/utils/testbed/testbed.ts b/packages/kbn-test-jest-helpers/src/testbed/testbed.ts similarity index 98% rename from packages/kbn-test/src/jest/utils/testbed/testbed.ts rename to packages/kbn-test-jest-helpers/src/testbed/testbed.ts index b10f331da10d6..87efb9e61b345 100644 --- a/packages/kbn-test/src/jest/utils/testbed/testbed.ts +++ b/packages/kbn-test-jest-helpers/src/testbed/testbed.ts @@ -7,6 +7,7 @@ */ import { Component as ReactComponent } from 'react'; +// eslint-disable-next-line import/no-extraneous-dependencies import { ComponentType, HTMLAttributes, ReactWrapper } from 'enzyme'; import { findTestSubject } from '../find_test_subject'; @@ -41,7 +42,7 @@ const defaultConfig: TestBedConfig = { * * @example ```typescript - import { registerTestBed } from '@kbn/test/jest'; + import { registerTestBed } from '@kbn/test-jest-helpers'; import { RemoteClusterList } from '../../app/sections/remote_cluster_list'; import { remoteClustersStore } from '../../app/store'; diff --git a/packages/kbn-test/src/jest/utils/testbed/types.ts b/packages/kbn-test-jest-helpers/src/testbed/types.ts similarity index 99% rename from packages/kbn-test/src/jest/utils/testbed/types.ts rename to packages/kbn-test-jest-helpers/src/testbed/types.ts index 11f8c802a9751..ff548f3af5f58 100644 --- a/packages/kbn-test/src/jest/utils/testbed/types.ts +++ b/packages/kbn-test-jest-helpers/src/testbed/types.ts @@ -7,6 +7,7 @@ */ import { Store } from 'redux'; +// eslint-disable-next-line import/no-extraneous-dependencies import { ReactWrapper as GenericReactWrapper } from 'enzyme'; import { LocationDescriptor } from 'history'; diff --git a/packages/kbn-test-jest-helpers/tsconfig.json b/packages/kbn-test-jest-helpers/tsconfig.json new file mode 100644 index 0000000000000..7a1121c9e91f1 --- /dev/null +++ b/packages/kbn-test-jest-helpers/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "./target_types", + "stripInternal": true, + "rootDir": "src", + "sourceMap": true, + "sourceRoot": "../../../../../../packages/kbn-test-jest-helpers/src", + "types": ["jest", "node"] + }, + "include": ["src/**/*"], + "exclude": ["**/__fixtures__/**/*"] +} diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index 67299f4afdeb7..33d299058168d 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -1,10 +1,11 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") +load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@npm//@babel/cli:index.bzl", "babel") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -load("//src/dev/bazel:index.bzl", "jsts_transpiler") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") PKG_BASE_NAME = "kbn-test" PKG_REQUIRE_NAME = "@kbn/test" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__test" SOURCE_FILES = glob( [ @@ -27,7 +28,6 @@ filegroup( ) NPM_MODULE_EXTRA_FILES = [ - "jest/package.json", "jest-preset.js", "jest_integration/jest-preset.js", "jest.config.js", @@ -80,7 +80,7 @@ TYPES_DEPS = [ "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-i18n-react:npm_module_types", "//packages/kbn-std:npm_module_types", - "//packages/kbn-utils", + "//packages/kbn-utils:npm_module_types", "@npm//@elastic/elasticsearch", "@npm//@jest/console", "@npm//@jest/reporters", @@ -148,7 +148,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -167,3 +167,20 @@ filegroup( ], visibility = ["//visibility:public"], ) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-test/jest/package.json b/packages/kbn-test/jest/package.json deleted file mode 100644 index aa0ba83873684..0000000000000 --- a/packages/kbn-test/jest/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "../target_node/jest", - "types": "../target_types/jest/index.d.ts" -} diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json index a94b3198e24a4..5f5e475e392c4 100644 --- a/packages/kbn-test/package.json +++ b/packages/kbn-test/package.json @@ -5,7 +5,6 @@ "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", "main": "./target_node", - "types": "./target_types", "kibana": { "devOnly": true } diff --git a/packages/kbn-test/src/index.ts b/packages/kbn-test/src/index.ts index a3772665b8891..b619a9eb9208a 100644 --- a/packages/kbn-test/src/index.ts +++ b/packages/kbn-test/src/index.ts @@ -49,7 +49,7 @@ export { CI_PARALLEL_PROCESS_PREFIX } from './ci_parallel_process_prefix'; export * from './functional_test_runner'; -export { getUrl } from './jest/utils/get_url'; +export { getUrl } from './jest/get_url'; export { runCheckJestConfigsCli } from './jest/run_check_jest_configs_cli'; diff --git a/packages/kbn-test/src/jest/utils/get_url.test.ts b/packages/kbn-test/src/jest/get_url.test.ts similarity index 100% rename from packages/kbn-test/src/jest/utils/get_url.test.ts rename to packages/kbn-test/src/jest/get_url.test.ts diff --git a/packages/kbn-test/src/jest/utils/get_url.ts b/packages/kbn-test/src/jest/get_url.ts similarity index 100% rename from packages/kbn-test/src/jest/utils/get_url.ts rename to packages/kbn-test/src/jest/get_url.ts diff --git a/src/core/public/application/ui/app_container.test.tsx b/src/core/public/application/ui/app_container.test.tsx index 9fc07530a0095..4434f6c1751e0 100644 --- a/src/core/public/application/ui/app_container.test.tsx +++ b/src/core/public/application/ui/app_container.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { themeServiceMock } from '../../theme/theme_service.mock'; import { AppContainer } from './app_container'; diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx index abc2fb5cc3356..0102343ca6eb7 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -10,7 +10,7 @@ import { mount, ReactWrapper } from 'enzyme'; import React from 'react'; import { BehaviorSubject } from 'rxjs'; import sinon from 'sinon'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { ChromeNavLink, DEFAULT_APP_CATEGORIES } from '../../..'; import { httpServiceMock } from '../../../http/http_service.mock'; import { ChromeRecentlyAccessedHistoryItem } from '../../recently_accessed'; diff --git a/src/core/public/chrome/ui/header/header.test.tsx b/src/core/public/chrome/ui/header/header.test.tsx index 2692f2dbd194f..4790dec0f3515 100644 --- a/src/core/public/chrome/ui/header/header.test.tsx +++ b/src/core/public/chrome/ui/header/header.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { BehaviorSubject } from 'rxjs'; -import { StubBrowserStorage, mountWithIntl } from '@kbn/test/jest'; +import { StubBrowserStorage, mountWithIntl } from '@kbn/test-jest-helpers'; import { httpServiceMock } from '../../../http/http_service.mock'; import { applicationServiceMock } from '../../../mocks'; import { Header } from './header'; diff --git a/src/core/public/core_app/status/components/status_badge.test.tsx b/src/core/public/core_app/status/components/status_badge.test.tsx index b0870e51d98d1..5c908cf5021cc 100644 --- a/src/core/public/core_app/status/components/status_badge.test.tsx +++ b/src/core/public/core_app/status/components/status_badge.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { StatusBadge, StatusWithoutMessage } from './status_badge'; const getStatus = (parts: Partial = {}): StatusWithoutMessage => ({ diff --git a/src/core/public/core_app/status/components/version_header.test.tsx b/src/core/public/core_app/status/components/version_header.test.tsx index d51927f83550b..172a720a51751 100644 --- a/src/core/public/core_app/status/components/version_header.test.tsx +++ b/src/core/public/core_app/status/components/version_header.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl, findTestSubject } from '@kbn/test/jest'; +import { mountWithIntl, findTestSubject } from '@kbn/test-jest-helpers'; import type { ServerVersion } from '../../../../types/status'; import { VersionHeader } from './version_header'; diff --git a/src/core/public/fatal_errors/fatal_errors_screen.test.tsx b/src/core/public/fatal_errors/fatal_errors_screen.test.tsx index 7c9abed79f4b7..b460e62b1151d 100644 --- a/src/core/public/fatal_errors/fatal_errors_screen.test.tsx +++ b/src/core/public/fatal_errors/fatal_errors_screen.test.tsx @@ -10,7 +10,7 @@ import { EuiCallOut } from '@elastic/eui'; import testSubjSelector from '@kbn/test-subj-selector'; import React from 'react'; import * as Rx from 'rxjs'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { FatalErrorsScreen } from './fatal_errors_screen'; diff --git a/src/core/public/notifications/toasts/error_toast.test.tsx b/src/core/public/notifications/toasts/error_toast.test.tsx index e0f917fb7f078..2af342c2107a7 100644 --- a/src/core/public/notifications/toasts/error_toast.test.tsx +++ b/src/core/public/notifications/toasts/error_toast.test.tsx @@ -8,7 +8,7 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ErrorToast } from './error_toast'; diff --git a/src/core/public/theme/core_theme_provider.test.tsx b/src/core/public/theme/core_theme_provider.test.tsx index a0f0faf13b9da..1ce26650dcccd 100644 --- a/src/core/public/theme/core_theme_provider.test.tsx +++ b/src/core/public/theme/core_theme_provider.test.tsx @@ -12,7 +12,7 @@ import type { ReactWrapper } from 'enzyme'; import { of, BehaviorSubject } from 'rxjs'; import { useEuiTheme } from '@elastic/eui'; import type { UseEuiTheme } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { CoreThemeProvider } from './core_theme_provider'; import type { CoreTheme } from './types'; diff --git a/src/core/server/preboot/preboot_service.test.ts b/src/core/server/preboot/preboot_service.test.ts index 77242f0c5765f..8a95f4bc9ab0e 100644 --- a/src/core/server/preboot/preboot_service.test.ts +++ b/src/core/server/preboot/preboot_service.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { REPO_ROOT } from '@kbn/utils'; import { LoggerFactory } from '@kbn/logging'; import { Env } from '@kbn/config'; diff --git a/src/plugins/advanced_settings/public/component_registry/page_footer/page_footer.test.tsx b/src/plugins/advanced_settings/public/component_registry/page_footer/page_footer.test.tsx index dbe5db1ebe2eb..b65c5c5020533 100644 --- a/src/plugins/advanced_settings/public/component_registry/page_footer/page_footer.test.tsx +++ b/src/plugins/advanced_settings/public/component_registry/page_footer/page_footer.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { PageFooter } from './page_footer'; diff --git a/src/plugins/advanced_settings/public/component_registry/page_subtitle/page_subtitle.test.tsx b/src/plugins/advanced_settings/public/component_registry/page_subtitle/page_subtitle.test.tsx index 0ffb9ae64e29f..792721490256f 100644 --- a/src/plugins/advanced_settings/public/component_registry/page_subtitle/page_subtitle.test.tsx +++ b/src/plugins/advanced_settings/public/component_registry/page_subtitle/page_subtitle.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { PageSubtitle } from './page_subtitle'; diff --git a/src/plugins/advanced_settings/public/component_registry/page_title/page_title.test.tsx b/src/plugins/advanced_settings/public/component_registry/page_title/page_title.test.tsx index e6142fe916ca7..05d44f3aee84d 100644 --- a/src/plugins/advanced_settings/public/component_registry/page_title/page_title.test.tsx +++ b/src/plugins/advanced_settings/public/component_registry/page_title/page_title.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { PageTitle } from './page_title'; diff --git a/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx b/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx index 91f4a5e6be471..a804b55938861 100644 --- a/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Observable } from 'rxjs'; import { ReactWrapper } from 'enzyme'; -import { mountWithI18nProvider, shallowWithI18nProvider } from '@kbn/test/jest'; +import { mountWithI18nProvider, shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import dedent from 'dedent'; import { PublicUiSettingsParams, diff --git a/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx b/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx index b77a687b50cd9..70d6a7a83d25f 100644 --- a/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { I18nProvider } from '@kbn/i18n-react'; -import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { mount, ReactWrapper } from 'enzyme'; import { FieldSetting } from '../../types'; import { UiSettingsType } from '../../../../../../core/public'; diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx index a371831dcb007..7d598aa182695 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { UiSettingsType } from '../../../../../../core/public'; import { themeServiceMock } from '../../../../../../core/public/mocks'; diff --git a/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx b/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx index 18684fa45f3a7..cef5978945bc8 100644 --- a/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx index 935c4d66a4506..ffb0328a1c97c 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx +++ b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx @@ -11,7 +11,7 @@ import { chartPluginMock } from '../../../../charts/public/mocks'; import { fieldFormatsServiceMock } from '../../../../field_formats/public/mocks'; import type { Datatable } from '../../../../expressions/public'; import { DatatableColumn, DatatableRow } from 'src/plugins/expressions/common'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { GaugeRenderProps, GaugeArguments, GaugeLabelMajorMode, ColorStop } from '../../common'; import GaugeComponent from './gauge_component'; import { Chart, Goal } from '@elastic/charts'; diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx index 105bd339cbca4..30d9e9d9b90f4 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx @@ -12,7 +12,7 @@ import { chartPluginMock } from '../../../../charts/public/mocks'; import { EmptyPlaceholder } from '../../../../charts/public'; import { fieldFormatsServiceMock } from '../../../../field_formats/public/mocks'; import type { Datatable } from '../../../../expressions/public'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { act } from 'react-dom/test-utils'; import { HeatmapRenderProps, HeatmapArguments } from '../../common'; diff --git a/src/plugins/chart_expressions/expression_pie/public/utils/get_color_picker.test.tsx b/src/plugins/chart_expressions/expression_pie/public/utils/get_color_picker.test.tsx index 6a2177ee573b0..1a9c785ed6dae 100644 --- a/src/plugins/chart_expressions/expression_pie/public/utils/get_color_picker.test.tsx +++ b/src/plugins/chart_expressions/expression_pie/public/utils/get_color_picker.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { LegendColorPickerProps } from '@elastic/charts'; import { EuiPopover } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { LegendColorPickerWrapper, diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx index d39ffb9755445..37da5f93ff675 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx @@ -16,7 +16,7 @@ import * as sinon from 'sinon'; import { serviceContextMock } from '../../../../contexts/services_context.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { ServicesContextProvider, EditorContextProvider, diff --git a/src/plugins/dashboard/public/application/actions/library_notification_popover.test.tsx b/src/plugins/dashboard/public/application/actions/library_notification_popover.test.tsx index a2a55404072eb..1dc490836808b 100644 --- a/src/plugins/dashboard/public/application/actions/library_notification_popover.test.tsx +++ b/src/plugins/dashboard/public/application/actions/library_notification_popover.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DashboardContainer } from '../embeddable/dashboard_container'; import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx index 5f50cfd842b67..761db3ca47ff8 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { findTestSubject, nextTick } from '@kbn/test/jest'; +import { findTestSubject, nextTick } from '@kbn/test-jest-helpers'; import { DashboardContainer, DashboardContainerServices } from './dashboard_container'; import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers'; import { I18nProvider } from '@kbn/i18n-react'; diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.test.tsx b/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.test.tsx index 3b4e2c06ab0a8..0b3a569813845 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DashboardEmptyScreen, DashboardEmptyScreenProps } from './dashboard_empty_screen'; import { coreMock } from '../../../../../../core/public/mocks'; diff --git a/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx index 59f346caf4b0d..4717082cbe0d0 100644 --- a/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx @@ -10,7 +10,7 @@ import sizeMe from 'react-sizeme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { skip } from 'rxjs/operators'; import { DashboardGrid, DashboardGridProps } from './dashboard_grid'; import { DashboardContainer, DashboardContainerServices } from '../dashboard_container'; diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx index d9de67ee9455d..9075a7f90b103 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { skip } from 'rxjs/operators'; import { mount } from 'enzyme'; import { I18nProvider } from '@kbn/i18n-react'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DashboardViewport, DashboardViewportProps } from './dashboard_viewport'; import { DashboardContainer, DashboardContainerServices } from '../dashboard_container'; import { getSampleDashboardInput } from '../../test_helpers'; diff --git a/src/plugins/dashboard/public/application/top_nav/clone_modal.test.js b/src/plugins/dashboard/public/application/top_nav/clone_modal.test.js index d7e35df65a7d2..0aab14334a997 100644 --- a/src/plugins/dashboard/public/application/top_nav/clone_modal.test.js +++ b/src/plugins/dashboard/public/application/top_nav/clone_modal.test.js @@ -8,7 +8,7 @@ import React from 'react'; import sinon from 'sinon'; -import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DashboardCloneModal } from './clone_modal'; diff --git a/src/plugins/dashboard/public/application/top_nav/save_modal.test.js b/src/plugins/dashboard/public/application/top_nav/save_modal.test.js index a532506595a3d..5a8cb8d56db69 100644 --- a/src/plugins/dashboard/public/application/top_nav/save_modal.test.js +++ b/src/plugins/dashboard/public/application/top_nav/save_modal.test.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; jest.mock('../../../../saved_objects/public', () => ({ SavedObjectSaveModal: () => null, diff --git a/src/plugins/data/public/query/query_string/query_string_manager.test.ts b/src/plugins/data/public/query/query_string/query_string_manager.test.ts index 54f0eb06fb04e..32852b4fe7c32 100644 --- a/src/plugins/data/public/query/query_string/query_string_manager.test.ts +++ b/src/plugins/data/public/query/query_string/query_string_manager.test.ts @@ -8,7 +8,7 @@ import { QueryStringManager } from './query_string_manager'; import { Storage } from '../../../../kibana_utils/public/storage'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { coreMock } from '../../../../../core/public/mocks'; import { Query } from '../../../common/query'; diff --git a/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts b/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts index 857a932d9157b..32e9ec7fb374a 100644 --- a/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts +++ b/src/plugins/data/public/query/state_sync/connect_to_query_state.test.ts @@ -13,7 +13,7 @@ import { Filter, FilterStateStore, UI_SETTINGS } from '../../../common'; import { coreMock } from '../../../../../core/public/mocks'; import { BaseStateContainer, createStateContainer, Storage } from '../../../../kibana_utils/public'; import { QueryService, QueryStart } from '../query_service'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { connectToQueryState } from './connect_to_query_state'; import { TimefilterContract } from '../timefilter'; import { QueryState } from './types'; diff --git a/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts b/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts index 2e48a11efd69c..2442ca68f997d 100644 --- a/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts +++ b/src/plugins/data/public/query/state_sync/sync_state_with_url.test.ts @@ -18,7 +18,7 @@ import { Storage, } from '../../../../kibana_utils/public'; import { QueryService, QueryStart } from '../query_service'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { TimefilterContract } from '../timefilter'; import { syncQueryStateWithUrl } from './sync_state_with_url'; import { QueryState } from './types'; diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/filter_editor.test.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/filter_editor.test.tsx index 3a0c0db96c5de..8f48bef8e0e54 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/filter_editor.test.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/filter_editor.test.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { FilterEditor, Props } from '.'; import React from 'react'; diff --git a/src/plugins/data/public/ui/query_string_input/language_switcher.test.tsx b/src/plugins/data/public/ui/query_string_input/language_switcher.test.tsx index acbd48718d92e..67d36f465568d 100644 --- a/src/plugins/data/public/ui/query_string_input/language_switcher.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/language_switcher.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { QueryLanguageSwitcher, QueryLanguageSwitcherProps } from './language_switcher'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; import { coreMock } from '../../../../../core/public/mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EuiButtonEmpty, EuiIcon, EuiPopover } from '@elastic/eui'; const startMock = coreMock.createStart(); diff --git a/src/plugins/data/public/ui/query_string_input/no_data_popover.test.tsx b/src/plugins/data/public/ui/query_string_input/no_data_popover.test.tsx index 53edaa8d9bf4f..f80fc68494091 100644 --- a/src/plugins/data/public/ui/query_string_input/no_data_popover.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/no_data_popover.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl as mount } from '@kbn/test/jest'; +import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { NoDataPopover } from './no_data_popover'; import { EuiTourStep } from '@elastic/eui'; import { act } from 'react-dom/test-utils'; diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.test.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.test.tsx index 94efcefb719a8..535b7ea66237b 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.test.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ShardFailureDescription } from './shard_failure_description'; import { shardFailureResponse } from './__mocks__/shard_failure_response'; import { ShardFailure } from './shard_failure_types'; diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.test.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.test.tsx index 35933250276c7..d4b30d5a1923b 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.test.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ShardFailureModal } from './shard_failure_modal'; import { shardFailureRequest } from './__mocks__/shard_failure_request'; import { shardFailureResponse } from './__mocks__/shard_failure_response'; diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.test.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.test.tsx index b8289bc23cf01..0cb71f9097f9e 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.test.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.test.tsx @@ -9,7 +9,7 @@ import { openModal } from './shard_failure_open_modal_button.test.mocks'; import React from 'react'; import { themeServiceMock } from 'src/core/public/mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import ShardFailureOpenModalButton from './shard_failure_open_modal_button'; import { shardFailureRequest } from './__mocks__/shard_failure_request'; import { shardFailureResponse } from './__mocks__/shard_failure_response'; diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_table.test.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_table.test.tsx index 32f245de53e7b..c4a53f850ab6a 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_table.test.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_table.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ShardFailureTable } from './shard_failure_table'; import { shardFailureResponse } from './__mocks__/shard_failure_response'; import { ShardFailure } from './shard_failure_types'; diff --git a/src/plugins/data/public/utils/table_inspector_view/components/data_view.test.tsx b/src/plugins/data/public/utils/table_inspector_view/components/data_view.test.tsx index e6b40bcb5936c..eb7f51aad8223 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/data_view.test.tsx +++ b/src/plugins/data/public/utils/table_inspector_view/components/data_view.test.tsx @@ -8,7 +8,7 @@ import React, { Suspense } from 'react'; import { getTableViewDescription } from '../index'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TablesAdapter } from '../../../../../expressions/common'; jest.mock('../../../../../share/public', () => ({ diff --git a/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx index f5a996a441515..3de6995267bb3 100644 --- a/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx +++ b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx @@ -11,7 +11,7 @@ import { EmptyIndexListPrompt } from './empty_index_list_prompt'; import { shallow } from 'enzyme'; import sinon from 'sinon'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; jest.mock('react-router-dom', () => ({ useHistory: () => ({ diff --git a/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx index 4cf3c4b55acde..242f124b326b8 100644 --- a/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx +++ b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EmptyIndexPatternPrompt } from '../empty_index_pattern_prompt'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; describe('EmptyIndexPatternPrompt', () => { it('should render normally', () => { diff --git a/src/plugins/data_view_editor/public/test_utils/test_utils.ts b/src/plugins/data_view_editor/public/test_utils/test_utils.ts index 311d93d31b593..1a553b74c19c8 100644 --- a/src/plugins/data_view_editor/public/test_utils/test_utils.ts +++ b/src/plugins/data_view_editor/public/test_utils/test_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -export { getRandomString } from '@kbn/test/jest'; +export { getRandomString } from '@kbn/test-jest-helpers'; -export type { TestBed } from '@kbn/test/jest'; -export { registerTestBed } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { registerTestBed } from '@kbn/test-jest-helpers'; diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.helpers.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.helpers.ts index 1fd280a937a03..f1cf9b862ebaa 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.helpers.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.helpers.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { Context } from '../../public/components/field_editor_context'; import { FieldEditor, Props } from '../../public/components/field_editor/field_editor'; diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts index 0e87756819bf2..c3816b0bfb8c3 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { Context } from '../../public/components/field_editor_context'; import { diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts index 305cf84d59622..9df7de5f65d62 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts @@ -7,7 +7,7 @@ */ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { API_BASE_PATH } from '../../common/constants'; import { Context } from '../../public/components/field_editor_context'; diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/common_actions.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/common_actions.ts index 9f8b52af5878e..77e8e8834a0f4 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/common_actions.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/common_actions.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; /** * We often need to wait for both the documents & the preview to be fetched. diff --git a/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/index.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/index.ts index 2fc870bd42d66..b29b76a9daf23 100644 --- a/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/index.ts +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/index.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -export type { TestBed } from '@kbn/test/jest'; -export { findTestSubject } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { findTestSubject } from '@kbn/test-jest-helpers'; export { setupEnvironment, diff --git a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx index 362fa0887b780..750cf8378f334 100644 --- a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { ColorFormatEditor } from './color'; import { FieldFormat, DEFAULT_CONVERTER_COLOR } from '../../../../../../field_formats/common'; diff --git a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/static_lookup/static_lookup.test.tsx b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/static_lookup/static_lookup.test.tsx index 5142f11ae87e5..9f2bd59d7ceb4 100644 --- a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/static_lookup/static_lookup.test.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/static_lookup/static_lookup.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { StaticLookupFormatEditorFormatParams } from './static_lookup'; import { FieldFormat } from 'src/plugins/field_formats/common'; diff --git a/src/plugins/data_view_field_editor/public/components/field_format_editor/samples/samples.test.tsx b/src/plugins/data_view_field_editor/public/components/field_format_editor/samples/samples.test.tsx index 433e08ad5bcd0..9b400dd4931e0 100644 --- a/src/plugins/data_view_field_editor/public/components/field_format_editor/samples/samples.test.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_format_editor/samples/samples.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { FormatEditorSamples } from './samples'; diff --git a/src/plugins/data_view_field_editor/public/plugin.test.tsx b/src/plugins/data_view_field_editor/public/plugin.test.tsx index 4f609965171b5..fe7e8c57cd4ec 100644 --- a/src/plugins/data_view_field_editor/public/plugin.test.tsx +++ b/src/plugins/data_view_field_editor/public/plugin.test.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import React from 'react'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; jest.mock('../../kibana_react/public', () => { const original = jest.requireActual('../../kibana_react/public'); diff --git a/src/plugins/discover/public/application/context/components/action_bar/action_bar.test.tsx b/src/plugins/discover/public/application/context/components/action_bar/action_bar.test.tsx index cce6c7fbe6053..5a4e959ccb576 100644 --- a/src/plugins/discover/public/application/context/components/action_bar/action_bar.test.tsx +++ b/src/plugins/discover/public/application/context/components/action_bar/action_bar.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ActionBar, ActionBarProps } from './action_bar'; import { findTestSubject } from '@elastic/eui/lib/test'; import { MAX_CONTEXT_SIZE, MIN_CONTEXT_SIZE } from '../../services/constants'; diff --git a/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.test.tsx b/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.test.tsx index 47937058451fa..049a3977b5b96 100644 --- a/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.test.tsx +++ b/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { ContextErrorMessage } from './context_error_message'; import { FailureReason, LoadingStatus } from '../../services/context_query_state'; diff --git a/src/plugins/discover/public/application/context/context_app.test.tsx b/src/plugins/discover/public/application/context/context_app.test.tsx index aa3428e52fa96..c9089a6c1111c 100644 --- a/src/plugins/discover/public/application/context/context_app.test.tsx +++ b/src/plugins/discover/public/application/context/context_app.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { waitFor } from '@testing-library/react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { createFilterManagerMock } from '../../../../data/public/query/filter_manager/filter_manager.mock'; import { mockTopNavMenu } from './__mocks__/top_nav_menu'; import { ContextAppContent } from './context_app_content'; diff --git a/src/plugins/discover/public/application/context/context_app_content.test.tsx b/src/plugins/discover/public/application/context/context_app_content.test.tsx index a066dbe0deddb..e57206bcba2c1 100644 --- a/src/plugins/discover/public/application/context/context_app_content.test.tsx +++ b/src/plugins/discover/public/application/context/context_app_content.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { ActionBar } from './components/action_bar/action_bar'; import { GetStateReturn } from './services/context_state'; diff --git a/src/plugins/discover/public/application/doc/components/doc.test.tsx b/src/plugins/discover/public/application/doc/components/doc.test.tsx index f9b024b9c6835..29453e7f83f19 100644 --- a/src/plugins/discover/public/application/doc/components/doc.test.tsx +++ b/src/plugins/discover/public/application/doc/components/doc.test.tsx @@ -9,7 +9,7 @@ import { throwError, of } from 'rxjs'; import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; import { Doc, DocProps } from './doc'; diff --git a/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx b/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx index 3feb8f2cea6b5..1be37081a01b5 100644 --- a/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx +++ b/src/plugins/discover/public/application/main/components/chart/discover_chart.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Subject, BehaviorSubject } from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { setHeaderActionMenuMounter } from '../../../../kibana_services'; import { esHits } from '../../../../__mocks__/es_hits'; import { savedSearchMock } from '../../../../__mocks__/saved_search'; diff --git a/src/plugins/discover/public/application/main/components/chart/histogram.test.tsx b/src/plugins/discover/public/application/main/components/chart/histogram.test.tsx index 547c6ffe42f48..d336cd2c092b6 100644 --- a/src/plugins/discover/public/application/main/components/chart/histogram.test.tsx +++ b/src/plugins/discover/public/application/main/components/chart/histogram.test.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { BehaviorSubject } from 'rxjs'; import { FetchStatus } from '../../../types'; import { DataCharts$ } from '../../utils/use_saved_search'; diff --git a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorere_callout.test.tsx b/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorere_callout.test.tsx index 37c9f2284aa20..3e6b8e3973001 100644 --- a/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorere_callout.test.tsx +++ b/src/plugins/discover/public/application/main/components/document_explorer_callout/document_explorere_callout.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { KibanaContextProvider } from '../../../../../../kibana_react/public'; import { CALLOUT_STATE_KEY, DocumentExplorerCallout } from './document_explorer_callout'; import { LocalStorageMock } from '../../../../__mocks__/local_storage_mock'; diff --git a/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.test.tsx b/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.test.tsx index d46600fca01f4..4ba4eda45d279 100644 --- a/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.test.tsx +++ b/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { HitsCounter, HitsCounterProps } from './hits_counter'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx index cf547b42c7277..78f18e0218872 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { BehaviorSubject } from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { setHeaderActionMenuMounter } from '../../../../kibana_services'; import { esHits } from '../../../../__mocks__/es_hits'; import { savedSearchMock } from '../../../../__mocks__/saved_search'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx index aa2149abdde62..7b0845cd199c0 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Subject, BehaviorSubject } from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { setHeaderActionMenuMounter } from '../../../../kibana_services'; import { DiscoverLayout, SIDEBAR_CLOSED_KEY } from './discover_layout'; import { esHits } from '../../../../__mocks__/es_hits'; diff --git a/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.test.tsx b/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.test.tsx index 020c6d38398ba..36978a1f72684 100644 --- a/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.test.tsx +++ b/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { LoadingSpinner } from './loading_spinner'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx b/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx index 2418416e5c277..4dc1a5feda5dc 100644 --- a/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx +++ b/src/plugins/discover/public/application/main/components/no_results/no_results.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DiscoverNoResults, DiscoverNoResultsProps } from './no_results'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/change_indexpattern.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/change_indexpattern.test.tsx index b61683c8de14a..a5e93c1d895bc 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/change_indexpattern.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/change_indexpattern.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiSelectable } from '@elastic/eui'; import { ShallowWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ChangeIndexPattern } from './change_indexpattern'; import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_field.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_field.test.tsx index 758738a6cbc56..c2ba365ef5fda 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_field.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_field.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DiscoverField } from './discover_field'; import { DataViewField } from '../../../../../../data/common'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.test.tsx index c63a50c17fa8f..77f2d0fd89d25 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DiscoverFieldDetails } from './discover_field_details'; import { DataViewField } from '../../../../../../data/common'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.test.tsx index e654d87ea2ba6..40474f3e4fc1d 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DiscoverFieldSearch, Props } from './discover_field_search'; import { EuiButtonGroupProps, EuiPopover } from '@elastic/eui'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.test.tsx index 153f1cb4c7b3d..73f460cccf784 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { ShallowWrapper } from 'enzyme'; import { ChangeIndexPattern } from './change_indexpattern'; import { SavedObject } from 'kibana/server'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern_management.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern_management.test.tsx index 272e8178aefc2..b511dc08f1e91 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern_management.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern_management.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl, findTestSubject } from '@kbn/test/jest'; +import { mountWithIntl, findTestSubject } from '@kbn/test-jest-helpers'; import { EuiContextMenuPanel, EuiPopover, EuiContextMenuItem } from '@elastic/eui'; import { DiscoverServices } from '../../../../build_services'; import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.test.tsx index b6dbf40cc7b3d..8a9e9a0ee6872 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.test.tsx @@ -12,7 +12,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; // @ts-expect-error import realHits from '../../../../__fixtures__/real_hits.js'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { DiscoverSidebarProps } from './discover_sidebar'; import { flattenHit, IndexPatternAttributes } from '../../../../../../data/common'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx index eee09f4ef481e..7f1f6b94eab16 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx @@ -13,7 +13,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; // @ts-expect-error import realHits from '../../../../__fixtures__/real_hits.js'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { flattenHit, IndexPatternAttributes } from '../../../../../../data/common'; import { SavedObject } from '../../../../../../../core/types'; diff --git a/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.test.tsx b/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.test.tsx index 0cdbbb7602e8c..21456ca59dab1 100644 --- a/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.test.tsx +++ b/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { SkipBottomButton, SkipBottomButtonProps } from './skip_bottom_button'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx index ca5eacd4fdb8a..2c5c5ffb37d69 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { savedSearchMock } from '../../../../__mocks__/saved_search'; import { DiscoverTopNav, DiscoverTopNavProps } from './discover_topnav'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx index c2059915b2af8..ef64e602280b4 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { OptionsPopover } from './open_options_popover'; diff --git a/src/plugins/discover/public/application/main/discover_main_app.test.tsx b/src/plugins/discover/public/application/main/discover_main_app.test.tsx index d1699900b1498..5d3b28bb35c5f 100644 --- a/src/plugins/discover/public/application/main/discover_main_app.test.tsx +++ b/src/plugins/discover/public/application/main/discover_main_app.test.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { indexPatternMock } from '../../__mocks__/index_pattern'; import { DiscoverMainApp } from './discover_main_app'; import { savedSearchMock } from '../../__mocks__/saved_search'; diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid.test.tsx index c4ef4ffef3234..f2b3b130e395c 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid.test.tsx @@ -12,7 +12,7 @@ import { act } from 'react-dom/test-utils'; import { findTestSubject } from '@elastic/eui/lib/test'; import { esHits } from '../../__mocks__/es_hits'; import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DiscoverGrid, DiscoverGridProps } from './discover_grid'; import { getDocId } from './discover_grid_document_selection'; import { ElasticSearchHit } from '../../types'; diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.test.tsx index 7568cb427e7b5..651004638a85e 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { FilterInBtn, FilterOutBtn, buildCellActions } from './discover_grid_cell_actions'; import { DiscoverGridContext } from './discover_grid_context'; diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.test.tsx index d57fba241a1e7..2afee7a6a48a3 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.test.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DiscoverGridDocumentToolbarBtn, diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_expand_button.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_expand_button.test.tsx index de2117afe7bdb..bb8341f746e85 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_expand_button.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_expand_button.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { ExpandButton } from './discover_grid_expand_button'; import { DiscoverGridContext } from './discover_grid_context'; diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx index a6c5ecdcdf35c..cc10da2dfc464 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DiscoverGridFlyout, DiscoverGridFlyoutProps } from './discover_grid_flyout'; import { esHits } from '../../__mocks__/es_hits'; import { createFilterManagerMock } from '../../../../data/public/query/filter_manager/filter_manager.mock'; diff --git a/src/plugins/discover/public/components/doc_table/components/table_header/table_header.test.tsx b/src/plugins/discover/public/components/doc_table/components/table_header/table_header.test.tsx index 60e9c25cb4532..d29bd02e92d35 100644 --- a/src/plugins/discover/public/components/doc_table/components/table_header/table_header.test.tsx +++ b/src/plugins/discover/public/components/doc_table/components/table_header/table_header.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { DataView, DataViewField } from 'src/plugins/data/common'; import { TableHeader } from './table_header'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/discover/public/components/doc_table/components/table_row.test.tsx b/src/plugins/discover/public/components/doc_table/components/table_row.test.tsx index 084fddc991f74..61e536129ffdb 100644 --- a/src/plugins/discover/public/components/doc_table/components/table_row.test.tsx +++ b/src/plugins/discover/public/components/doc_table/components/table_row.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl, findTestSubject } from '@kbn/test/jest'; +import { mountWithIntl, findTestSubject } from '@kbn/test-jest-helpers'; import { TableRow, TableRowProps } from './table_row'; import { setDocViewsRegistry } from '../../../kibana_services'; import { createFilterManagerMock } from '../../../../../data/public/query/filter_manager/filter_manager.mock'; diff --git a/src/plugins/discover/public/components/doc_table/doc_table_wrapper.test.tsx b/src/plugins/discover/public/components/doc_table/doc_table_wrapper.test.tsx index 3634a47e3bcf1..9de67c340f8bd 100644 --- a/src/plugins/discover/public/components/doc_table/doc_table_wrapper.test.tsx +++ b/src/plugins/discover/public/components/doc_table/doc_table_wrapper.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { indexPatternMock } from '../../__mocks__/index_pattern'; import { DocTableWrapper } from './doc_table_wrapper'; import { DocTableRow } from './components/table_row'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.test.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.test.tsx index 70648b46d7804..986ad37384c92 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.test.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { DataView } from 'src/plugins/data/common'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DocViewerSource } from './source'; import * as hooks from '../../../../utils/use_es_doc_search'; import * as useUiSettingHook from '../../../../../../kibana_react/public/ui_settings/use_ui_setting'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/legacy/table.test.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/legacy/table.test.tsx index cb85315e7dd42..26dbd76a1dc1a 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/legacy/table.test.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/legacy/table.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DocViewerLegacyTable } from './table'; import { DataView } from '../../../../../../../data/common'; diff --git a/src/plugins/discover/public/services/saved_searches/saved_search_url_conflict_callout.test.tsx b/src/plugins/discover/public/services/saved_searches/saved_search_url_conflict_callout.test.tsx index 0aac9aea62192..6bdea087fcf46 100644 --- a/src/plugins/discover/public/services/saved_searches/saved_search_url_conflict_callout.test.tsx +++ b/src/plugins/discover/public/services/saved_searches/saved_search_url_conflict_callout.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import type { History } from 'history'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { SavedSearchURLConflictCallout } from './saved_search_url_conflict_callout'; import type { SavedSearch } from './types'; diff --git a/src/plugins/discover/public/utils/with_query_params.test.tsx b/src/plugins/discover/public/utils/with_query_params.test.tsx index 3d416d6a3e8b5..e23688c0031c7 100644 --- a/src/plugins/discover/public/utils/with_query_params.test.tsx +++ b/src/plugins/discover/public/utils/with_query_params.test.tsx @@ -9,7 +9,7 @@ import React, { ReactElement } from 'react'; import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { withQueryParams } from './with_query_params'; const mountComponent = (children: ReactElement, query = '') => { diff --git a/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx index d5452870ed0de..07867476508a5 100644 --- a/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { EmbeddableChildPanel } from './embeddable_child_panel'; import { CONTACT_CARD_EMBEDDABLE } from '../test_samples/embeddables/contact_card/contact_card_embeddable_factory'; import { SlowContactCardEmbeddableFactory } from '../test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory'; diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx index 8d313030556c6..81ea83fe06d10 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { I18nProvider } from '@kbn/i18n-react'; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx index 1c96945f014c8..c860fc7e770b9 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.test.tsx @@ -16,7 +16,7 @@ import { import { HelloWorldContainer } from '../../../../test_samples/embeddables/hello_world_container'; import { ContactCardEmbeddable } from '../../../../test_samples/embeddables/contact_card/contact_card_embeddable'; import { ContainerInput } from '../../../../containers'; -import { mountWithIntl as mount } from '@kbn/test/jest'; +import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { coreMock } from '../../../../../../../../core/public/mocks'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx index be8416da38700..79e68aabe577a 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/tests/saved_object_finder_create_new.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { SavedObjectFinderCreateNew } from '../saved_object_finder_create_new'; import { shallow } from 'enzyme'; import { EuiButton, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; describe('SavedObjectFinderCreateNew', () => { test('renders correctly with no items', () => { diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts index 4d04778398938..983f9ceedf369 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_action.test.ts @@ -7,7 +7,7 @@ */ import { Container, isErrorEmbeddable } from '../../../..'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { CustomizePanelTitleAction } from './customize_panel_action'; import { ContactCardEmbeddable, diff --git a/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx index 44cd93069bfb3..baae08b23cfa1 100644 --- a/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx +++ b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx @@ -24,7 +24,7 @@ import { testPlugin } from './test_plugin'; import { CustomizePanelModal } from '../lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal'; import { EmbeddableStart } from '../plugin'; import { createEmbeddablePanelMock } from '../mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { OverlayStart } from 'kibana/public'; let api: EmbeddableStart; diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx index 0ae82872124a4..cb8994b153bdd 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import sinon from 'sinon'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithI18nProvider } from '@kbn/test/jest'; +import { mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { Frequency } from './types'; import { CronEditor } from './cron_editor'; diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts index cd9bb97cab8d9..113d33dba7100 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts @@ -7,9 +7,6 @@ */ // eslint-disable-next-line import/no-extraneous-dependencies -export type { TestBed } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; // eslint-disable-next-line import/no-extraneous-dependencies -export { registerTestBed } from '@kbn/test/jest'; - -// eslint-disable-next-line import/no-extraneous-dependencies -export { getRandomString } from '@kbn/test/jest'; +export { registerTestBed, getRandomString } from '@kbn/test-jest-helpers'; diff --git a/src/plugins/home/public/application/components/add_data/add_data.test.tsx b/src/plugins/home/public/application/components/add_data/add_data.test.tsx index 3aa51f89c7d67..009b72791263b 100644 --- a/src/plugins/home/public/application/components/add_data/add_data.test.tsx +++ b/src/plugins/home/public/application/components/add_data/add_data.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { AddData } from './add_data'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ApplicationStart } from 'kibana/public'; jest.mock('../app_navigation_handler', () => { diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx index fb222be657786..f602ee5aa4439 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ManageData } from './manage_data'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ApplicationStart } from 'kibana/public'; import { FeatureCatalogueEntry, FeatureCatalogueCategory } from '../../../services'; diff --git a/src/plugins/home/public/application/components/recently_accessed.test.js b/src/plugins/home/public/application/components/recently_accessed.test.js index 14611d26aa8e5..95f151923f425 100644 --- a/src/plugins/home/public/application/components/recently_accessed.test.js +++ b/src/plugins/home/public/application/components/recently_accessed.test.js @@ -10,7 +10,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { RecentlyAccessed, NUM_LONG_LINKS } from './recently_accessed'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; const createRecentlyAccessed = (length) => { const recentlyAccessed = []; diff --git a/src/plugins/home/public/application/components/tutorial/instruction_set.test.js b/src/plugins/home/public/application/components/tutorial/instruction_set.test.js index 6faadf275bea3..8c0ce306d9c05 100644 --- a/src/plugins/home/public/application/components/tutorial/instruction_set.test.js +++ b/src/plugins/home/public/application/components/tutorial/instruction_set.test.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { InstructionSet } from './instruction_set'; import * as StatusCheckStates from './status_check_states'; diff --git a/src/plugins/home/public/application/components/tutorial/introduction.test.js b/src/plugins/home/public/application/components/tutorial/introduction.test.js index 70b4856a8b2fd..c599c8748e925 100644 --- a/src/plugins/home/public/application/components/tutorial/introduction.test.js +++ b/src/plugins/home/public/application/components/tutorial/introduction.test.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { Introduction } from './introduction'; import { httpServiceMock } from '../../../../../../core/public/mocks'; diff --git a/src/plugins/home/public/application/components/tutorial/saved_objects_installer.test.js b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.test.js index 0efcd9bf9df9c..67ae2d1dd2eed 100644 --- a/src/plugins/home/public/application/components/tutorial/saved_objects_installer.test.js +++ b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.test.js @@ -8,7 +8,7 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { SavedObjectsInstaller } from './saved_objects_installer'; diff --git a/src/plugins/home/public/application/components/tutorial/tutorial.test.js b/src/plugins/home/public/application/components/tutorial/tutorial.test.js index 73499c0dcb75f..9bfe100c4ce60 100644 --- a/src/plugins/home/public/application/components/tutorial/tutorial.test.js +++ b/src/plugins/home/public/application/components/tutorial/tutorial.test.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { Tutorial } from './tutorial'; diff --git a/src/plugins/input_control_vis/public/components/editor/controls_tab.test.tsx b/src/plugins/input_control_vis/public/components/editor/controls_tab.test.tsx index 3257b7dab0825..2182843d30975 100644 --- a/src/plugins/input_control_vis/public/components/editor/controls_tab.test.tsx +++ b/src/plugins/input_control_vis/public/components/editor/controls_tab.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { getDepsMock, getIndexPatternMock } from '../../test_utils'; import ControlsTab, { ControlsTabProps } from './controls_tab'; diff --git a/src/plugins/input_control_vis/public/components/editor/list_control_editor.test.tsx b/src/plugins/input_control_vis/public/components/editor/list_control_editor.test.tsx index 27597bb3a1e52..3192cd3db54ad 100644 --- a/src/plugins/input_control_vis/public/components/editor/list_control_editor.test.tsx +++ b/src/plugins/input_control_vis/public/components/editor/list_control_editor.test.tsx @@ -12,7 +12,7 @@ import { shallow } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { getIndexPatternMock } from '../../test_utils/get_index_pattern_mock'; import { ListControlEditor } from './list_control_editor'; import { ControlParams } from '../../editor_utils'; diff --git a/src/plugins/input_control_vis/public/components/editor/options_tab.test.tsx b/src/plugins/input_control_vis/public/components/editor/options_tab.test.tsx index 8b886134c1173..45907fc08e1c2 100644 --- a/src/plugins/input_control_vis/public/components/editor/options_tab.test.tsx +++ b/src/plugins/input_control_vis/public/components/editor/options_tab.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { Vis } from '../../../../visualizations/public'; import OptionsTab, { OptionsTabProps } from './options_tab'; diff --git a/src/plugins/input_control_vis/public/components/editor/range_control_editor.test.tsx b/src/plugins/input_control_vis/public/components/editor/range_control_editor.test.tsx index 2494a0b57dbc5..67ee222b3bae9 100644 --- a/src/plugins/input_control_vis/public/components/editor/range_control_editor.test.tsx +++ b/src/plugins/input_control_vis/public/components/editor/range_control_editor.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { SinonSpy, spy, assert } from 'sinon'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/input_control_vis/public/components/vis/input_control_vis.test.tsx b/src/plugins/input_control_vis/public/components/vis/input_control_vis.test.tsx index 3eb78cfe81544..6d9f2f9b05ade 100644 --- a/src/plugins/input_control_vis/public/components/vis/input_control_vis.test.tsx +++ b/src/plugins/input_control_vis/public/components/vis/input_control_vis.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import sinon from 'sinon'; import { shallow } from 'enzyme'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { InputControlVis } from './input_control_vis'; diff --git a/src/plugins/input_control_vis/public/components/vis/list_control.test.tsx b/src/plugins/input_control_vis/public/components/vis/list_control.test.tsx index 5f102b58a7b42..cf90ad9837bfe 100644 --- a/src/plugins/input_control_vis/public/components/vis/list_control.test.tsx +++ b/src/plugins/input_control_vis/public/components/vis/list_control.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import sinon from 'sinon'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ListControl } from './list_control'; diff --git a/src/plugins/input_control_vis/public/components/vis/range_control.test.tsx b/src/plugins/input_control_vis/public/components/vis/range_control.test.tsx index 4396da3df827b..d51db16952f1e 100644 --- a/src/plugins/input_control_vis/public/components/vis/range_control.test.tsx +++ b/src/plugins/input_control_vis/public/components/vis/range_control.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { RangeControl, ceilWithPrecision, floorWithPrecision } from './range_control'; import { RangeControl as RangeControlClass } from '../../control/range_control_factory'; diff --git a/src/plugins/inspector/public/ui/inspector_panel.test.tsx b/src/plugins/inspector/public/ui/inspector_panel.test.tsx index 03b71219b1e9f..254afca11c1da 100644 --- a/src/plugins/inspector/public/ui/inspector_panel.test.tsx +++ b/src/plugins/inspector/public/ui/inspector_panel.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { InspectorPanel } from './inspector_panel'; import { InspectorViewDescription } from '../types'; import { Adapters } from '../../common'; diff --git a/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx b/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx index 21059bd4a8236..5d1bc9798ee17 100644 --- a/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx +++ b/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx @@ -13,7 +13,7 @@ import React, { useEffect } from 'react'; import { act } from 'react-dom/test-utils'; import { BehaviorSubject, of } from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { CoreTheme } from 'src/core/public'; import { KibanaThemeProvider } from './kibana_theme_provider'; diff --git a/src/plugins/interactive_setup/server/elasticsearch_service.test.ts b/src/plugins/interactive_setup/server/elasticsearch_service.test.ts index 5956bf3a2f64a..e7b326a1d019d 100644 --- a/src/plugins/interactive_setup/server/elasticsearch_service.test.ts +++ b/src/plugins/interactive_setup/server/elasticsearch_service.test.ts @@ -10,7 +10,7 @@ import { errors } from '@elastic/elasticsearch'; import { BehaviorSubject } from 'rxjs'; import tls from 'tls'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { elasticsearchServiceMock, loggingSystemMock } from 'src/core/server/mocks'; import { pollEsNodesVersion } from '../../../../src/core/server'; diff --git a/src/plugins/kibana_overview/public/components/add_data/add_data.test.tsx b/src/plugins/kibana_overview/public/components/add_data/add_data.test.tsx index 4c58b034186c4..ed091ff96c5f2 100644 --- a/src/plugins/kibana_overview/public/components/add_data/add_data.test.tsx +++ b/src/plugins/kibana_overview/public/components/add_data/add_data.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { AddData } from './add_data'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { FeatureCatalogueCategory } from 'src/plugins/home/public'; const mockFeatures = [ diff --git a/src/plugins/kibana_overview/public/components/manage_data/manage_data.test.tsx b/src/plugins/kibana_overview/public/components/manage_data/manage_data.test.tsx index 2a028a7a53a11..f5e72a3e0a867 100644 --- a/src/plugins/kibana_overview/public/components/manage_data/manage_data.test.tsx +++ b/src/plugins/kibana_overview/public/components/manage_data/manage_data.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ManageData } from './manage_data'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { FeatureCatalogueCategory } from 'src/plugins/home/public'; const mockFeatures = [ diff --git a/src/plugins/kibana_overview/public/components/news_feed/news_feed.test.tsx b/src/plugins/kibana_overview/public/components/news_feed/news_feed.test.tsx index 0215242d0c078..420230e7caef6 100644 --- a/src/plugins/kibana_overview/public/components/news_feed/news_feed.test.tsx +++ b/src/plugins/kibana_overview/public/components/news_feed/news_feed.test.tsx @@ -9,7 +9,7 @@ import moment from 'moment'; import React from 'react'; import { NewsFeed } from './news_feed'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; const mockNewsFetchResult = { error: null, diff --git a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx index b4804fe56f470..85aee7411d7ad 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx @@ -13,7 +13,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { Overview } from './overview'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { FeatureCatalogueCategory } from 'src/plugins/home/public'; const mockNewsFetchResult = { diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx index 62488809dd59b..b66d136c50710 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ReactWrapper } from 'enzyme'; -import { mountWithIntl, findTestSubject } from '@kbn/test/jest'; +import { mountWithIntl, findTestSubject } from '@kbn/test-jest-helpers'; import { monaco } from '@kbn/monaco'; import { keys } from '@elastic/eui'; diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.test.tsx b/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.test.tsx index 1fbde1bb8bfe9..ec48d3fda4c73 100644 --- a/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.test.tsx +++ b/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { OverviewPageFooter } from './overview_page_footer'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; jest.mock('../../app_links', () => ({ RedirectAppLinks: jest.fn((element: JSX.Element) => element), diff --git a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.test.tsx b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.test.tsx index 59d6e8280af98..2c9f91be339f6 100644 --- a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.test.tsx +++ b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { NoDataPage } from './no_data_page'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; describe('NoDataPage', () => { test('render', () => { diff --git a/src/plugins/kibana_react/public/table_list_view/table_list_view.test.tsx b/src/plugins/kibana_react/public/table_list_view/table_list_view.test.tsx index bdc5ca30216bc..cf8ff8ac8ec53 100644 --- a/src/plugins/kibana_react/public/table_list_view/table_list_view.test.tsx +++ b/src/plugins/kibana_react/public/table_list_view/table_list_view.test.tsx @@ -7,7 +7,7 @@ */ import { EuiEmptyPrompt } from '@elastic/eui'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ToastsStart } from 'kibana/public'; import React from 'react'; import { themeServiceMock } from '../../../../../src/core/public/mocks'; diff --git a/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx b/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx index ef7f79cdaa64e..10c1f32e6ec26 100644 --- a/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx +++ b/src/plugins/kibana_react/public/theme/kibana_theme_provider.test.tsx @@ -12,7 +12,7 @@ import type { ReactWrapper } from 'enzyme'; import { of, BehaviorSubject } from 'rxjs'; import { useEuiTheme } from '@elastic/eui'; import type { UseEuiTheme } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { CoreTheme } from 'src/core/public'; import { KibanaThemeProvider } from './kibana_theme_provider'; diff --git a/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.test.ts b/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.test.ts index 8d22665fdf2cc..3c748fab8e0c1 100644 --- a/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.test.ts +++ b/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { createMemoryHistory, History } from 'history'; import { createKbnUrlTracker, KbnUrlTracker } from './kbn_url_tracker'; import { BehaviorSubject, Subject } from 'rxjs'; diff --git a/src/plugins/kibana_utils/public/state_management/url/url_tracker.test.ts b/src/plugins/kibana_utils/public/state_management/url/url_tracker.test.ts index 2bc1f1e57f117..42a12c3fd0c5d 100644 --- a/src/plugins/kibana_utils/public/state_management/url/url_tracker.test.ts +++ b/src/plugins/kibana_utils/public/state_management/url/url_tracker.test.ts @@ -7,7 +7,7 @@ */ import { createUrlTracker, IUrlTracker } from './url_tracker'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { createMemoryHistory, History } from 'history'; describe('urlTracker', () => { diff --git a/src/plugins/kibana_utils/public/state_sync/state_sync.test.ts b/src/plugins/kibana_utils/public/state_sync/state_sync.test.ts index 6fac5731d50a3..f752c6e25c8ab 100644 --- a/src/plugins/kibana_utils/public/state_sync/state_sync.test.ts +++ b/src/plugins/kibana_utils/public/state_sync/state_sync.test.ts @@ -22,7 +22,7 @@ import { IKbnUrlStateStorage, ISessionStorageStateStorage, } from './state_sync_state_storage'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { createBrowserHistory, History } from 'history'; import { INullableBaseStateContainer } from './types'; diff --git a/src/plugins/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.test.ts b/src/plugins/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.test.ts index cad2fc2733f3c..a0ab2b3f9da3d 100644 --- a/src/plugins/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.test.ts +++ b/src/plugins/kibana_utils/public/state_sync/state_sync_state_storage/create_session_storage_state_storage.test.ts @@ -10,7 +10,7 @@ import { createSessionStorageStateStorage, ISessionStorageStateStorage, } from './create_session_storage_state_storage'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; describe('SessionStorageStateStorage', () => { let browserStorage: StubBrowserStorage; diff --git a/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts b/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts index b7ee08044b323..20cc81bc3b75b 100644 --- a/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts +++ b/src/plugins/kibana_utils/public/storage/hashed_item_store/hashed_item_store.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { HashedItemStore } from './hashed_item_store'; describe('hashedItemStore', () => { diff --git a/src/plugins/kibana_utils/public/storage/hashed_item_store/mock.ts b/src/plugins/kibana_utils/public/storage/hashed_item_store/mock.ts index 56408d2cbdb5b..0f2176b5d4ba9 100644 --- a/src/plugins/kibana_utils/public/storage/hashed_item_store/mock.ts +++ b/src/plugins/kibana_utils/public/storage/hashed_item_store/mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { HashedItemStore } from './hashed_item_store'; /** diff --git a/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx b/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx index 21059bd4a8236..5d1bc9798ee17 100644 --- a/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx +++ b/src/plugins/kibana_utils/public/theme/kibana_theme_provider.test.tsx @@ -13,7 +13,7 @@ import React, { useEffect } from 'react'; import { act } from 'react-dom/test-utils'; import { BehaviorSubject, of } from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { CoreTheme } from 'src/core/public'; import { KibanaThemeProvider } from './kibana_theme_provider'; diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx index 45b9b4c7a885b..682154dd5d5db 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx @@ -12,7 +12,7 @@ import { act } from 'react-dom/test-utils'; import { MountPoint } from 'kibana/public'; import { TopNavMenu } from './top_nav_menu'; import { TopNavMenuData } from './top_nav_menu_data'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; const dataShim = { ui: { diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.test.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.test.tsx index 8d62a3ebd9633..2211ae5db1052 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.test.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_menu_item.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { TopNavMenuItem } from './top_nav_menu_item'; import { TopNavMenuData } from './top_nav_menu_data'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; describe('TopNavMenu', () => { const ensureMenuItemDisabled = (data: TopNavMenuData) => { diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.test.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.test.tsx index 2c530df7b93ae..8e939ec58a792 100644 --- a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.test.tsx +++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.test.tsx @@ -10,7 +10,7 @@ import { shallow } from 'enzyme'; import React from 'react'; import { SavedObjectSaveModal } from './saved_object_save_modal'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; describe('SavedObjectSaveModal', () => { it('should render matching snapshot', () => { diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/inspect.test.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/inspect.test.tsx index 843468b78307c..4e852de7ee731 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/inspect.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/inspect.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ShallowWrapper } from 'enzyme'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { Inspect, InspectProps } from './inspect'; import { SavedObjectWithMetadata } from '../../../../common'; diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/saved_object_view.test.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/saved_object_view.test.tsx index 554e34a9fc55a..ba0a584a94074 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/saved_object_view.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/saved_object_view.test.tsx @@ -10,7 +10,7 @@ import { bulkGetObjectsMock } from './saved_object_view.test.mocks'; import React from 'react'; import { ShallowWrapper } from 'enzyme'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { httpServiceMock, diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.test.tsx index 396ef209cc396..3c24d68007222 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { SavedObjectWithMetadata, SavedObjectManagementTypeInfo } from '../../../../common'; import { DeleteConfirmModal } from './delete_confirm_modal'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.test.tsx index eb364dbf69102..609338f7aed38 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ExportModal } from './export_modal'; describe('ExportModal', () => { diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx index a084c26b04d2d..04d4556548720 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx @@ -9,7 +9,7 @@ import { importFileMock, resolveImportErrorsMock } from './flyout.test.mocks'; import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { coreMock, httpServiceMock } from '../../../../../../core/public/mocks'; import { Flyout, FlyoutProps, FlyoutState } from './flyout'; import { ShallowWrapper } from 'enzyme'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx index fbf50e0ee0c86..481e8cd91903f 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ReactWrapper } from 'enzyme'; -import { shallowWithI18nProvider, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithIntl } from '@kbn/test-jest-helpers'; import { ImportModeControl, ImportModeControlProps } from './import_mode_control'; describe('ImportModeControl', () => { diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.test.tsx index 4cbfcb06b3595..03d3631398cda 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ReactWrapper } from 'enzyme'; -import { mountWithI18nProvider } from '@kbn/test/jest'; +import { mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { httpServiceMock } from '../../../../../../core/public/mocks'; import { ImportSummary, ImportSummaryProps } from './import_summary'; import { FailedImport } from '../../../lib'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.test.tsx index ef9020d231f31..c07ab70079ccf 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithIntl } from '@kbn/test-jest-helpers'; import { OverwriteModalProps, OverwriteModal } from './overwrite_modal'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.test.tsx index a3db8af627d2f..751335e4670d9 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { httpServiceMock } from '../../../../../../core/public/mocks'; import type { SavedObjectManagementTypeInfo } from '../../../../common/types'; import { Relationships, RelationshipsProps } from './relationships'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx index 6fb153cb980ff..c0b795f9e9610 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { keys } from '@elastic/eui'; import { httpServiceMock } from '../../../../../../core/public/mocks'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx index 173d8af0de04d..5382cc39989ed 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx @@ -19,7 +19,7 @@ import { import React from 'react'; import { Query } from '@elastic/eui'; import { ShallowWrapper } from 'enzyme'; -import { shallowWithI18nProvider } from '@kbn/test/jest'; +import { shallowWithI18nProvider } from '@kbn/test-jest-helpers'; import { httpServiceMock, overlayServiceMock, diff --git a/src/plugins/telemetry/public/components/opt_in_banner.test.tsx b/src/plugins/telemetry/public/components/opt_in_banner.test.tsx index b892633b66b9a..1c4467db803c4 100644 --- a/src/plugins/telemetry/public/components/opt_in_banner.test.tsx +++ b/src/plugins/telemetry/public/components/opt_in_banner.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { OptInBanner } from './opt_in_banner'; describe('OptInDetailsComponent', () => { diff --git a/src/plugins/telemetry/public/components/opt_in_message.test.tsx b/src/plugins/telemetry/public/components/opt_in_message.test.tsx index c27e4326c6625..1196e36a1b424 100644 --- a/src/plugins/telemetry/public/components/opt_in_message.test.tsx +++ b/src/plugins/telemetry/public/components/opt_in_message.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { OptInMessage } from './opt_in_message'; describe('OptInMessage', () => { diff --git a/src/plugins/telemetry/public/components/opted_in_notice_banner.test.tsx b/src/plugins/telemetry/public/components/opted_in_notice_banner.test.tsx index ce5a42ed17ad8..e4ec8e32c5456 100644 --- a/src/plugins/telemetry/public/components/opted_in_notice_banner.test.tsx +++ b/src/plugins/telemetry/public/components/opted_in_notice_banner.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { OptedInNoticeBanner } from './opted_in_notice_banner'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { httpServiceMock } from '../../../../core/public/http/http_service.mock'; diff --git a/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.test.tsx b/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.test.tsx index 52c6ecfefbacf..845d7d3fa0c8a 100644 --- a/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.test.tsx +++ b/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { OptInExampleFlyout } from './opt_in_example_flyout'; describe('OptInDetailsComponent', () => { diff --git a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx index 8f27c340720a1..4b474f0cc7bdd 100644 --- a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx +++ b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import TelemetryManagementSection from './telemetry_management_section'; import { TelemetryService } from '../../../telemetry/public/services'; import { coreMock } from '../../../../core/public/mocks'; @@ -257,7 +257,7 @@ describe('TelemetryManagementSectionComponent', () => { await expect( toggleOptInComponent.prop('handleChange')() ).resolves.toBe(true); - // TODO: Fix `mountWithIntl` types in @kbn/test/jest to make testing easier + // TODO: Fix `mountWithIntl` types in @kbn/test-jest-helpers to make testing easier expect((component.state() as { enabled: boolean }).enabled).toBe(true); await expect( toggleOptInComponent.prop('handleChange')() diff --git a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.test.tsx b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.test.tsx index af363dbacaff7..87c74d0c497a7 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { NumberList, NumberListProps } from './number_list'; import { NumberRow } from './number_row'; diff --git a/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx b/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx index 02cc0aadfff61..00da70d7687f8 100644 --- a/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/date_ranges.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DateRangesParamEditor } from './date_ranges'; import { KibanaContextProvider } from '../../../../kibana_react/public'; import { docLinksServiceMock } from '../../../../../core/public/mocks'; diff --git a/src/plugins/vis_default_editor/public/components/controls/palette_picker.test.tsx b/src/plugins/vis_default_editor/public/components/controls/palette_picker.test.tsx index 21fdde725cd91..a02bdc6cdb6b4 100644 --- a/src/plugins/vis_default_editor/public/components/controls/palette_picker.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/palette_picker.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { PalettePicker, PalettePickerProps } from './palette_picker'; import { chartPluginMock } from '../../../../charts/public/mocks'; diff --git a/src/plugins/vis_default_editor/public/components/controls/percentiles.test.tsx b/src/plugins/vis_default_editor/public/components/controls/percentiles.test.tsx index c009196c20d8c..a94c68c944d12 100644 --- a/src/plugins/vis_default_editor/public/components/controls/percentiles.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/percentiles.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { AggParamEditorProps } from '../agg_param_props'; import { IAggConfig } from 'src/plugins/data/public'; -import { mountWithIntl as mount } from '@kbn/test/jest'; +import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { PercentilesEditor } from './percentiles'; import { EditorVisState } from '../sidebar/state/reducers'; diff --git a/src/plugins/vis_default_editor/public/components/controls/size.test.tsx b/src/plugins/vis_default_editor/public/components/controls/size.test.tsx index 0d86b6074bce5..9081ed5745254 100644 --- a/src/plugins/vis_default_editor/public/components/controls/size.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/size.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { EuiIconTip } from '@elastic/eui'; import { SizeParamEditor, SizeParamEditorProps } from './size'; import { aggParamCommonPropsMock } from './test_utils'; diff --git a/src/plugins/vis_default_editor/public/components/controls/top_aggregate.test.tsx b/src/plugins/vis_default_editor/public/components/controls/top_aggregate.test.tsx index 9c83403c60cb4..95e3a74a66d70 100644 --- a/src/plugins/vis_default_editor/public/components/controls/top_aggregate.test.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/top_aggregate.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { AggregateValueProp, TopAggregateParamEditor, diff --git a/src/plugins/vis_default_editor/public/components/options/long_legend_options.test.tsx b/src/plugins/vis_default_editor/public/components/options/long_legend_options.test.tsx index a95a47bf7af88..0db6473d74d0e 100644 --- a/src/plugins/vis_default_editor/public/components/options/long_legend_options.test.tsx +++ b/src/plugins/vis_default_editor/public/components/options/long_legend_options.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { LongLegendOptions, LongLegendOptionsProps } from './long_legend_options'; import { EuiFieldNumber } from '@elastic/eui'; diff --git a/src/plugins/vis_default_editor/public/components/options/percentage_mode.test.tsx b/src/plugins/vis_default_editor/public/components/options/percentage_mode.test.tsx index 05d321a7b465c..5f45f619d2e4d 100644 --- a/src/plugins/vis_default_editor/public/components/options/percentage_mode.test.tsx +++ b/src/plugins/vis_default_editor/public/components/options/percentage_mode.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { PercentageModeOption, PercentageModeOptionProps } from './percentage_mode'; import { EuiFieldText } from '@elastic/eui'; diff --git a/src/plugins/vis_types/heatmap/public/editor/components/heatmap.test.tsx b/src/plugins/vis_types/heatmap/public/editor/components/heatmap.test.tsx index 5f57083072202..bb1467c658f76 100644 --- a/src/plugins/vis_types/heatmap/public/editor/components/heatmap.test.tsx +++ b/src/plugins/vis_types/heatmap/public/editor/components/heatmap.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import type { PersistedState } from '../../../../../visualizations/public'; import HeatmapOptions, { HeatmapOptionsProps } from './heatmap'; diff --git a/src/plugins/vis_types/pie/public/editor/components/pie.test.tsx b/src/plugins/vis_types/pie/public/editor/components/pie.test.tsx index d6dc4c0734e42..aac0c5aef6001 100644 --- a/src/plugins/vis_types/pie/public/editor/components/pie.test.tsx +++ b/src/plugins/vis_types/pie/public/editor/components/pie.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import PieOptions, { PieOptionsProps } from './pie'; import { chartPluginMock } from '../../../../../charts/public/mocks'; diff --git a/src/plugins/vis_types/pie/public/editor/components/truncate_labels.test.tsx b/src/plugins/vis_types/pie/public/editor/components/truncate_labels.test.tsx index 1d4bb238dcb50..fc5731dc6839f 100644 --- a/src/plugins/vis_types/pie/public/editor/components/truncate_labels.test.tsx +++ b/src/plugins/vis_types/pie/public/editor/components/truncate_labels.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { TruncateLabelsOption, TruncateLabelsOptionProps } from './truncate_labels'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/add_delete_buttons.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/add_delete_buttons.test.tsx index 43e59222e0e1e..d6bd687d60055 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/add_delete_buttons.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/add_delete_buttons.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { AddDeleteButtons } from './add_delete_buttons'; describe('AddDeleteButtons', () => { diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/agg_select.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/aggs/agg_select.test.tsx index 3dbeb257900b7..ccdf60ea9cf98 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/agg_select.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/agg_select.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { AggSelect } from './agg_select'; import { METRIC, SERIES } from '../../../test_utils'; import { EuiComboBox } from '@elastic/eui'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.test.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.test.js index bd9ceeeb74028..38305395bfbb6 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.test.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.test.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { FilterRatioAgg } from './filter_ratio'; import { FIELDS, METRIC, SERIES, PANEL } from '../../../test_utils'; import { EuiComboBox } from '@elastic/eui'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/histogram_support.test.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/histogram_support.test.js index ff96e476814ff..b97968ff62241 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/histogram_support.test.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/histogram_support.test.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { Agg } from './agg'; import { FieldSelect } from './field_select'; import { FIELDS, METRIC, SERIES, PANEL } from '../../../test_utils'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/multi_value_row.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/multi_value_row.test.tsx index 7b08715ba1a93..d0a140a15b488 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/multi_value_row.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/multi_value_row.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { MultiValueRow } from './multi_value_row'; import { ColorPicker } from '../../color_picker'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.test.tsx index b143c0bf6ceab..edb0ae4d79884 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; // @ts-ignore not-typed yet import { Percentiles } from './percentile_ui'; import { ColorPicker } from '../color_picker'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/color_rules.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/color_rules.test.tsx index d6009a214941f..6dafe5cd456fb 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/color_rules.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/color_rules.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { keys } from '@elastic/eui'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { collectionActions } from './lib/collection_actions'; import { diff --git a/src/plugins/vis_types/timeseries/public/application/components/palette_picker.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/palette_picker.test.tsx index 81b33943f8b04..489896662033b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/palette_picker.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/palette_picker.test.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { PalettePicker, PalettePickerProps } from './palette_picker'; import { chartPluginMock } from '../../../../../charts/public/mocks'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.test.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.test.tsx index b8af2e7ef8539..9a23d8513500c 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.test.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; jest.mock('../lib/get_default_query_language', () => ({ getDefaultQueryLanguage: () => 'kuery', diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.test.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.test.js index 32904ba682768..b2fb7bfff0b3e 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.test.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.test.js @@ -8,7 +8,7 @@ import React from 'react'; import { GaugeSeries } from './series'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; const defaultProps = { disableAdd: true, diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.test.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.test.js index c33fa2d3f442d..709ea8b23ca33 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.test.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.test.js @@ -8,7 +8,7 @@ import React from 'react'; import { MetricSeries } from './series'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; const defaultProps = { disableAdd: false, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js index 54b326a292845..5c3fd271fc6ca 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js @@ -12,7 +12,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; import { ChartTitle } from './chart_title'; import { VisConfig } from './vis_config'; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js index 21a3dc069d8c6..a500aa00e6d21 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js @@ -13,7 +13,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; // Data import data from '../../fixtures/mock_data/date_histogram/_series'; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js index 60ffaf3f3d19c..d82dbb1ae77d7 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js @@ -11,7 +11,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; // Data import series from '../../fixtures/mock_data/date_histogram/_series'; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js index af59f011515d0..50fcdba6aa360 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js @@ -12,7 +12,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; // Data import series from '../../../fixtures/mock_data/date_histogram/_series'; diff --git a/src/plugins/vis_types/vislib/public/vislib/vis.test.js b/src/plugins/vis_types/vislib/public/vislib/vis.test.js index 46afbd1c62f69..b20bbfc700c8b 100644 --- a/src/plugins/vis_types/vislib/public/vislib/vis.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/vis.test.js @@ -12,7 +12,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; import series from '../fixtures/mock_data/date_histogram/_series'; import columns from '../fixtures/mock_data/date_histogram/_columns'; import rows from '../fixtures/mock_data/date_histogram/_rows'; diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js index 21ec67707126c..12fc0e9a5e4b8 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js @@ -12,7 +12,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; import { Chart } from './_chart'; import { getMockUiState } from '../../fixtures/mocks'; import { getVis } from './_vis_fixture'; diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/gauge_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/gauge_chart.test.js index 76830c66f3aa5..47cd2833464e8 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/gauge_chart.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/gauge_chart.test.js @@ -8,7 +8,7 @@ import $ from 'jquery'; import _ from 'lodash'; -import { setHTMLElementClientSizes, setSVGElementGetBBox } from '@kbn/test/jest'; +import { setHTMLElementClientSizes, setSVGElementGetBBox } from '@kbn/test-jest-helpers'; import data from '../../fixtures/mock_data/terms/_series_multiple'; import { getMockUiState } from '../../fixtures/mocks'; diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/pie_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/pie_chart.test.js index 8ad9bf56cb020..ba11df923b8a6 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/pie_chart.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/pie_chart.test.js @@ -13,7 +13,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; import { getMockUiState } from '../../fixtures/mocks'; import { getVis } from './_vis_fixture'; import { pieChartMockData } from './pie_chart_mock_data'; diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/heatmap_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/heatmap_chart.test.js index d9bac77acf5ad..c7dbaacfdae9e 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/heatmap_chart.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/heatmap_chart.test.js @@ -13,7 +13,7 @@ import { setHTMLElementClientSizes, setSVGElementGetBBox, setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; // Data import series from '../../../fixtures/mock_data/date_histogram/_series'; diff --git a/src/plugins/vis_types/xy/public/editor/components/common/truncate_labels.test.tsx b/src/plugins/vis_types/xy/public/editor/components/common/truncate_labels.test.tsx index 902167cb24642..a688ddb722620 100644 --- a/src/plugins/vis_types/xy/public/editor/components/common/truncate_labels.test.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/common/truncate_labels.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { TruncateLabelsOption, TruncateLabelsOptionProps } from './truncate_labels'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.test.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.test.tsx index 3e1a44993235b..53acb302e9889 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.test.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { Position } from '@elastic/charts'; import { ValueAxis, SeriesParam } from '../../../../types'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.test.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.test.tsx index 5bf9486bbc4ee..dbd1bed390574 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.test.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { PointSeriesOptions } from './point_series'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx b/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx index 352cff0d4c4a9..89cb8d50d4b8e 100644 --- a/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx +++ b/src/plugins/vis_types/xy/public/utils/get_color_picker.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { LegendColorPickerProps, XYChartSeriesIdentifier } from '@elastic/charts'; import { EuiPopover } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ComponentType, ReactWrapper } from 'enzyme'; import { getColorPicker } from './get_color_picker'; import { ColorPicker } from '../../../../charts/public'; diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.test.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.test.tsx index d0c7b56638bc2..81f0bd8d99909 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.test.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_editor_common.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { VisualizeEditorCommon } from './visualize_editor_common'; import { VisualizeEditorVisInstance } from '../types'; import { SplitChartWarning } from './split_chart_warning'; diff --git a/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.test.tsx b/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.test.tsx index e3707a7aace79..b776068ab9c49 100644 --- a/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.test.tsx +++ b/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TypesStart, BaseVisType, VisGroups } from '../../vis_types'; import { AggBasedSelection } from './agg_based_selection'; diff --git a/src/plugins/visualizations/public/wizard/group_selection/group_selection.test.tsx b/src/plugins/visualizations/public/wizard/group_selection/group_selection.test.tsx index 04824ae25704d..ae9d13b879cf7 100644 --- a/src/plugins/visualizations/public/wizard/group_selection/group_selection.test.tsx +++ b/src/plugins/visualizations/public/wizard/group_selection/group_selection.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TypesStart, BaseVisType, VisGroups } from '../../vis_types'; import { GroupSelection } from './group_selection'; import { DocLinksStart } from '../../../../../core/public'; diff --git a/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx b/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx index 7514f467840e5..ae65251409c20 100644 --- a/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx +++ b/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TypesStart, VisGroups, BaseVisType } from '../vis_types'; import NewVisModal from './new_vis_modal'; import { ApplicationStart, SavedObjectsStart, DocLinksStart } from '../../../../core/public'; diff --git a/x-pack/plugins/cases/public/components/empty_value/empty_value.test.tsx b/x-pack/plugins/cases/public/components/empty_value/empty_value.test.tsx index e1dfc71867f6e..47e6ec259640c 100644 --- a/x-pack/plugins/cases/public/components/empty_value/empty_value.test.tsx +++ b/x-pack/plugins/cases/public/components/empty_value/empty_value.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { defaultToEmptyTag, diff --git a/x-pack/plugins/cloud/public/plugin.test.ts b/x-pack/plugins/cloud/public/plugin.test.ts index 7198fb6f8a774..1eef581610f00 100644 --- a/x-pack/plugins/cloud/public/plugin.test.ts +++ b/x-pack/plugins/cloud/public/plugin.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { homePluginMock } from 'src/plugins/home/public/mocks'; import { securityMock } from '../../security/public/mocks'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/auto_follow_pattern.ts b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/auto_follow_pattern.ts index fe43f517f7f3f..ad7d95fc64c2e 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/auto_follow_pattern.ts +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/auto_follow_pattern.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; import { AutoFollowPattern } from '../../../../common/types'; export const getAutoFollowPatternMock = ({ diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/follower_index.ts b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/follower_index.ts index e2f48e688610e..c3a52400dea00 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/follower_index.ts +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/fixtures/follower_index.ts @@ -6,7 +6,7 @@ */ import Chance from 'chance'; -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; import { FollowerIndex } from '../../../../common/types'; const chance = new Chance(); diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js index 9f2cb6452c6f2..b3e47b2ad7dca 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/follower_indices_list.test.js @@ -11,7 +11,7 @@ Could not load worker ReferenceError: Worker is not defined at createWorker (//node_modules/brace/index.js:17992:5) */ -import { stubWebWorker } from '@kbn/test/jest'; // eslint-disable-line no-unused-vars +import { stubWebWorker } from '@kbn/test-jest-helpers'; // eslint-disable-line no-unused-vars import { act } from 'react-dom/test-utils'; import { getFollowerIndexMock } from './fixtures/follower_index'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js index c1902e22265b8..138ea72bfe7ff 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_add.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { AutoFollowPatternAdd } from '../../../app/sections/auto_follow_pattern_add'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js index 43d677596690f..0b6e6216209d8 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_edit.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { AutoFollowPatternEdit } from '../../../app/sections/auto_follow_pattern_edit'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js index 329d83d6fe3c7..0c7f483685075 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/auto_follow_pattern_list.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, findTestSubject } from '@kbn/test-jest-helpers'; import { AutoFollowPatternList } from '../../../app/sections/home/auto_follow_pattern_list'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js index a873af2de8b06..ab107348bd5b7 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_add.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { FollowerIndexAdd } from '../../../app/sections/follower_index_add'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js index f8a68e54ea52e..5f83aa841b11d 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_edit.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { FollowerIndexEdit } from '../../../app/sections/follower_index_edit'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js index 5e6a48413b18b..961ce940084e7 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/follower_index_list.helpers.js @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, findTestSubject } from '@kbn/test-jest-helpers'; import { FollowerIndicesList } from '../../../app/sections/home/follower_indices_list'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js index 1f03a56fbbcdb..8263b14e9eaab 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/home.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { CrossClusterReplicationHome } from '../../../app/sections/home/home'; import { ccrStore } from '../../../app/store'; import { routing } from '../../../app/services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/index.js b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/index.js index 5f910565edb3a..0fedc1ab6b903 100644 --- a/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/index.js +++ b/x-pack/plugins/cross_cluster_replication/public/__jest__/client_integration/helpers/index.js @@ -13,7 +13,7 @@ import { setup as followerIndexAddSetup } from './follower_index_add.helpers'; import { setup as followerIndexEditSetup } from './follower_index_edit.helpers'; import { setup as homeSetup } from './home.helpers'; -export { nextTick, getRandomString, findTestSubject, delay } from '@kbn/test/jest'; +export { nextTick, getRandomString, findTestSubject, delay } from '@kbn/test-jest-helpers'; export { setupEnvironment } from './setup_environment'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx b/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx index 6e9b06ad36df7..5f5753b8858e0 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx +++ b/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx @@ -6,7 +6,7 @@ */ import React, { ReactNode } from 'react'; -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { render, waitFor, screen, act } from '@testing-library/react'; import { Storage } from '../../../../../../../src/plugins/kibana_utils/public/'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.test.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.test.js index 8a4695f823128..a81b3b5865008 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.test.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { FILE_FORMATS } from '../../../../../common/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts index 62ba44128663a..a87555c58014a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts @@ -11,7 +11,7 @@ jest.mock('../engine', () => ({ EngineLogic: { values: { engineName: 'test-engine' } }, })); -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/test_helpers/shared_columns_tests.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/test_helpers/shared_columns_tests.tsx index ea5a28c02c989..d9ffb83a561c4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/test_helpers/shared_columns_tests.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/components/analytics_tables/test_helpers/shared_columns_tests.tsx @@ -14,7 +14,7 @@ import '../../../../../__mocks__/engine_logic.mock'; import { ReactWrapper } from 'enzyme'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; export const runActionColumnTests = (wrapper: ReactWrapper) => { const { http } = mockHttpValues; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts index 51d51b5aee88c..35fa74374acb2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.test.ts @@ -13,7 +13,7 @@ import { import { mockApiLog } from './__mocks__/api_log.mock'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DEFAULT_META } from '../../../shared/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts index 466ccc61838f0..08bd78b5298d4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts @@ -26,7 +26,7 @@ jest.mock('./utils', () => ({ getDomainWithProtocol: jest.fn().mockImplementation((domain) => domain), })); -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { CrawlerLogic } from '../../crawler_logic'; import { CrawlerDomain } from '../../types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler_logic.test.ts index 3c95243459a1c..5c9e95e097dd4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler_logic.test.ts @@ -20,7 +20,7 @@ jest.mock('./manage_crawls_popover_logic', () => ({ }, })); -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { CrawlUnits } from '../../types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/manage_crawls_popover_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/manage_crawls_popover_logic.test.ts index f80465fa2c407..da879192efdfa 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/manage_crawls_popover_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/manage_crawls_popover_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../../../__mocks__/kea_logic'; import '../../../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { CrawlerDomain } from '../../types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.test.ts index 152fe0f64de4d..f24fe4576e449 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.test.ts @@ -8,7 +8,7 @@ import { LogicMounter, mockHttpValues } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_domains_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_domains_logic.test.ts index fda96ca5f8381..a4963d7f21b51 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_domains_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_domains_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { Meta } from '../../../../../common/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts index 0735b5262a20a..e622798e688ab 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts index 547218ad6a2c1..53b63831f14b7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts @@ -21,7 +21,7 @@ jest.mock('./crawler_logic', () => ({ }, })); -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts index decb98d227975..4ccd91959831a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts @@ -11,7 +11,7 @@ import { mockHttpValues, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DEFAULT_META } from '../../../shared/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/suggestions_logic.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/suggestions_logic.test.tsx index a3ca646bd9f54..db9ee7a4bd12b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/suggestions_logic.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/suggestions_logic.test.tsx @@ -8,7 +8,7 @@ import { LogicMounter, mockHttpValues } from '../../../../__mocks__/kea_logic'; import '../../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DEFAULT_META } from '../../../../shared/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts index 644139250c07c..193d397b1fb50 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../../__mocks__/kea_logic'; import '../../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.test.ts index 71d8b65f1a639..d8fcc01c29a96 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DEFAULT_META } from '../../../shared/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curation_suggestion/curation_suggestion_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curation_suggestion/curation_suggestion_logic.test.ts index e7ac2b3610998..8b20c6a64e073 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curation_suggestion/curation_suggestion_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curation_suggestion/curation_suggestion_logic.test.ts @@ -14,7 +14,7 @@ import { import '../../../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../../../test_helpers'; import { HydratedCurationSuggestion } from '../../types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_history/components/ignored_queries_panel/ignored_queries_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_history/components/ignored_queries_panel/ignored_queries_logic.test.ts index af9f876820790..fd6589330e43f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_history/components/ignored_queries_panel/ignored_queries_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_history/components/ignored_queries_panel/ignored_queries_logic.test.ts @@ -16,7 +16,7 @@ import { itShowsServerErrorAsFlashMessage } from '../../../../../../../test_help // I don't know why eslint is saying this line is out of order // eslint-disable-next-line import/order -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { IgnoredQueriesLogic } from './ignored_queries_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx index b95ae0bca5bf6..73559b2c4b757 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx @@ -17,7 +17,7 @@ import { shallow, ShallowWrapper } from 'enzyme'; import { EuiButtonEmpty, EuiCallOut, EuiSwitch } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { docLinks } from '../../../../../shared/doc_links'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts index e9643f92f2f71..e3f8a47b401b4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts @@ -17,7 +17,7 @@ jest.mock('../../curations_logic', () => ({ }, })); -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { CurationsLogic } from '../..'; import { itShowsServerErrorAsFlashMessage } from '../../../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts index 753871765896a..edd5c5566a45d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts @@ -9,7 +9,7 @@ import { LogicMounter, mockHttpValues } from '../../../__mocks__/kea_logic'; import dedent from 'dedent'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; jest.mock('../engine', () => ({ EngineLogic: { values: { engineName: 'test-engine' } }, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts index 848a85f23c2cb..3cdad784a7d27 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../__mocks__/kea_logic'; import { mockEngineValues } from '../../__mocks__'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { InternalSchemaType } from '../../../shared/schema/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts index adcc6bc546629..2b0a4627a64b3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts @@ -11,7 +11,7 @@ import { mockFlashMessageHelpers, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { SchemaType } from '../../../shared/schema/types'; import { ApiTokenTypes } from '../credentials/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts index 70ff3b5adc078..3379b5d7850c8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts @@ -12,7 +12,7 @@ import { mockFlashMessageHelpers, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { EngineCreationLogic } from './engine_creation_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts index 142aab98a643b..6f0454ca73754 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.test.ts @@ -11,7 +11,7 @@ jest.mock('../engine', () => ({ EngineLogic: { values: { engineName: 'some-engine' } }, })); -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts index d0a227c8c6fbe..9659745aeb61d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts @@ -11,7 +11,7 @@ import { mockFlashMessageHelpers, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DEFAULT_META } from '../../../shared/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts index 20c5860160b78..c254a978f8789 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.test.ts @@ -11,7 +11,7 @@ import { mockFlashMessageHelpers, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { LogRetentionOptions } from './types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.test.ts index a785f70a4edb7..9f03044476263 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.test.ts @@ -12,7 +12,7 @@ import { mockKibanaValues, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { MetaEngineCreationLogic } from './meta_engine_creation_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts index 6ac1c27a27959..605c5ee9d7e80 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../__mocks__/kea_logic'; import { mockEngineValues, mockEngineActions } from '../../__mocks__'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts index 92cb2346e0a26..f498d53c509d1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts @@ -10,7 +10,7 @@ import { mockEngineValues } from '../../__mocks__'; import { omit } from 'lodash'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { Schema, SchemaConflicts, SchemaType } from '../../../shared/schema/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts index 426934b95388e..ee20fab3da66c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/sample_response/sample_response_logic.test.ts @@ -8,7 +8,7 @@ import { LogicMounter, mockHttpValues } from '../../../../__mocks__/kea_logic'; import '../../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { flashAPIErrors } from '../../../../shared/flash_messages'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.test.ts index a7422b34d2843..d6802c303807b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.test.ts @@ -13,7 +13,7 @@ import { import { engines } from '../../__mocks__/engines.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { elasticsearchUsers } from '../../../shared/role_mapping/__mocks__/elasticsearch_users'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.test.ts index 0b8e5e97cf5ed..dd469a486ca45 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.test.ts @@ -12,7 +12,7 @@ import { mockFlashMessageHelpers, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { SampleEngineCreationCtaLogic } from './sample_engine_creation_cta_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts index bb8156a8b55fa..67c88d211f118 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../../__mocks__/kea_logic'; import '../../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { ReindexJobLogic } from './reindex_job_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.test.ts index 5b40b362bc665..e12ad7405742a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.test.ts @@ -8,7 +8,7 @@ import { LogicMounter, mockHttpValues } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { SchemaType } from '../../../shared/schema/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.test.ts index 484996b710524..8f74a44f8a930 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../__mocks__/kea_logic'; import { mockEngineActions } from '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { SchemaType, Schema } from '../../../shared/schema/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts index d4f5ee29f7467..a56d2f7d5c949 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.test.ts @@ -12,7 +12,7 @@ import { mockFlashMessageHelpers, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { SearchLogic } from './search_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts index 49444fbd0c5c5..58f6f3d98eb28 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../__mocks__/kea_logic'; import { mockEngineValues } from '../../__mocks__'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts index 75d3c46ef72ee..eaaf43259185e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts @@ -13,7 +13,7 @@ import { import { mockRecursivelyFetchEngines } from '../../__mocks__'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { EngineLogic } from '../engine'; import { EngineDetails } from '../engine/types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts index 7376bc11df79e..b00619359f6c8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts index c03ca8267993a..2eb7f5cb3cdfb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts @@ -7,7 +7,7 @@ import { mockHttpValues } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts index 481013d91bf6f..a87aadcc04995 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/generic_endpoint_inline_editable_table/generic_endpoint_inline_editable_table_logic.test.ts @@ -21,7 +21,7 @@ import { mockHttpValues, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { GenericEndpointInlineEditableTableLogic } from './generic_endpoint_inline_editable_table_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/test_helpers/error_handling.ts b/x-pack/plugins/enterprise_search/public/applications/test_helpers/error_handling.ts index 4f1f4a40aa503..8f17edf6628fa 100644 --- a/x-pack/plugins/enterprise_search/public/applications/test_helpers/error_handling.ts +++ b/x-pack/plugins/enterprise_search/public/applications/test_helpers/error_handling.ts @@ -7,7 +7,7 @@ import { mockFlashMessageHelpers } from '../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { HttpHandler } from 'src/core/public'; export const itShowsServerErrorAsFlashMessage = (httpMethod: HttpHandler, callback: () => void) => { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/api_keys_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/api_keys_logic.test.ts index a02b1578bd38a..2013539b45b27 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/api_keys_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/api_keys_logic.test.ts @@ -11,7 +11,7 @@ import { mockHttpValues, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { DEFAULT_META } from '../../../shared/constants'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts index da4e9cad9e276..371f01cdad212 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../../../__mocks__/kea_logic'; import { sourceConfigData } from '../../../../__mocks__/content_sources.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts index 81a97c2d19e16..336f892bad51b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../../../__mocks__/kea_logic'; import { exampleResult } from '../../../../__mocks__/content_sources.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts index 748e5068833cf..e266fb310faa7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts @@ -12,7 +12,7 @@ import { } from '../../../../../__mocks__/kea_logic'; import { mostRecentIndexJob } from '../../../../__mocks__/content_sources.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; const contentSource = { id: 'source123' }; jest.mock('../../source_logic', () => ({ diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/synchronization_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/synchronization_logic.test.ts index 0ccfd6aa63ae4..20a6ba238a2f4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/synchronization_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/synchronization_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../../../__mocks__/kea_logic'; import { fullContentSources } from '../../../../__mocks__/content_sources.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts index df61e23fa3cdc..85b324f0a31bc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts @@ -14,7 +14,7 @@ import { import { groups } from '../../__mocks__/groups.mock'; import { mockGroupValues } from './__mocks__/group_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; import { GROUPS_PATH } from '../../routes'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts index 15951a9f8b9ca..14300f98ddf29 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.test.ts @@ -15,7 +15,7 @@ import { groups } from '../../__mocks__/groups.mock'; import { users } from '../../__mocks__/users.mock'; import { mockGroupsValues } from './__mocks__/groups_logic.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { JSON_HEADER as headers } from '../../../../../common/constants'; import { DEFAULT_META } from '../../../shared/constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts index 747feb9bc5880..6e90d5de3db8a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts @@ -11,7 +11,7 @@ import { mockHttpValues, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { OAuthAuthorizeLogic, transformServerPreAuth } from './oauth_authorize_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts index 9379c81afe199..b3246171ee5a7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts @@ -13,7 +13,7 @@ import { import { groups } from '../../__mocks__/groups.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { elasticsearchUsers } from '../../../shared/role_mapping/__mocks__/elasticsearch_users'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/search_authorize/search_authorize_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/search_authorize/search_authorize_logic.test.ts index bc8e1942e7a1f..1aaa9ec622078 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/search_authorize/search_authorize_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/search_authorize/search_authorize_logic.test.ts @@ -11,7 +11,7 @@ import { mockHttpValues, } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { SearchAuthorizeLogic } from './search_authorize_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts index df9035d57e56b..5469376f1ca33 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts @@ -7,7 +7,7 @@ import { LogicMounter, mockHttpValues } from '../../../__mocks__/kea_logic'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.test.tsx index 876891161b28b..b8f4c55bc7bab 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; import { EuiFilePicker, EuiConfirmModal } from '@elastic/eui'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; jest.mock('../../../utils', () => ({ readUploadedFileAsBase64: jest.fn(({ img }) => img), diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts index d98c9efe04d8c..f226434b8b8c0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts @@ -13,7 +13,7 @@ import { } from '../../../__mocks__/kea_logic'; import { configuredSources, oauthApplication } from '../../__mocks__/content_sources.mock'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { itShowsServerErrorAsFlashMessage } from '../../../test_helpers'; import { ORG_UPDATED_MESSAGE, OAUTH_APP_UPDATED_MESSAGE } from '../../constants'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx index 0e6138aea7cb4..617bd95e18a6d 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx @@ -8,7 +8,7 @@ import './agent_enrollment_flyout.test.mocks'; import React from 'react'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/global_search/public/services/utils.test.ts b/x-pack/plugins/global_search/public/services/utils.test.ts index 8f22ee8082e81..99d55bf608ebf 100644 --- a/x-pack/plugins/global_search/public/services/utils.test.ts +++ b/x-pack/plugins/global_search/public/services/utils.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { StubBrowserStorage } from '@kbn/test/jest'; +import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { getDefaultPreference } from './utils'; describe('getDefaultPreference', () => { diff --git a/x-pack/plugins/graph/public/components/search_bar.test.tsx b/x-pack/plugins/graph/public/components/search_bar.test.tsx index 7d39e8027e92b..58a2996fd1e67 100644 --- a/x-pack/plugins/graph/public/components/search_bar.test.tsx +++ b/x-pack/plugins/graph/public/components/search_bar.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { SearchBar, SearchBarProps } from './search_bar'; import React, { Component, ReactElement } from 'react'; import { CoreStart } from 'src/core/public'; diff --git a/x-pack/plugins/graph/public/components/settings/settings.test.tsx b/x-pack/plugins/graph/public/components/settings/settings.test.tsx index 1c3fbb9f54f67..96d5a2a5b2bac 100644 --- a/x-pack/plugins/graph/public/components/settings/settings.test.tsx +++ b/x-pack/plugins/graph/public/components/settings/settings.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiTab, EuiListGroupItem, EuiButton, EuiAccordion, EuiFieldText } from '@elastic/eui'; import * as Rx from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { Settings, SettingsWorkspaceProps } from './settings'; import { act } from '@testing-library/react'; import { ReactWrapper } from 'enzyme'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.helpers.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.helpers.tsx index 8d55a3e093a31..153f1c09c53a9 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.helpers.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.helpers.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test-jest-helpers'; import { docLinksServiceMock } from 'src/core/public/mocks'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { createBreadcrumbsMock } from '../../../public/application/services/breadcrumbs.mock'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/edit_warning.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/edit_warning.test.ts index 521d5d4da8cef..83b3a9fc53398 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/edit_warning.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/edit_warning.test.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { setupEnvironment } from '../../helpers'; import { initTestBed } from '../init_test_bed'; import { getDefaultHotPhasePolicy, POLICY_NAME } from '../constants'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/frozen_phase.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/frozen_phase.test.ts index aaa2b3dafddde..57a70237be6e1 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/frozen_phase.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/frozen_phase.test.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { licensingMock } from '../../../../../licensing/public/mocks'; import { setupEnvironment } from '../../helpers'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cloud_aware_behavior.helpers.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cloud_aware_behavior.helpers.ts index 9741ee87bda10..a0a1c80c90bbe 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cloud_aware_behavior.helpers.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cloud_aware_behavior.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBedConfig } from '@kbn/test/jest'; +import { TestBedConfig } from '@kbn/test-jest-helpers'; import { AppServicesContext } from '../../../../../public/types'; import { createTogglePhaseAction, createNodeAllocationActions } from '../../../helpers'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/validation.helpers.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/validation.helpers.ts index 84ee96cd46987..5b5d3819c3463 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/validation.helpers.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/form_validation/validation.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBedConfig } from '@kbn/test/jest'; +import { TestBedConfig } from '@kbn/test-jest-helpers'; import { createColdPhaseActions, createDeletePhaseActions, diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/init_test_bed.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/init_test_bed.tsx index 251ff234c230e..64d5cd65cda68 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/init_test_bed.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/init_test_bed.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBedConfig } from '@kbn/test-jest-helpers'; import { docLinksServiceMock } from 'src/core/public/mocks'; import '../helpers/global_mocks'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/errors_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/errors_actions.ts index 34d07d4a36ff9..4b863071e191c 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/errors_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/errors_actions.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; const createWaitForValidationAction = (testBed: TestBed) => () => { diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/forcemerge_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/forcemerge_actions.ts index f2a27aba9ec56..b6ed40de36ca9 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/forcemerge_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/forcemerge_actions.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; import { createFormToggleAction } from './form_toggle_action'; import { createFormSetValueAction } from './form_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_set_value_action.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_set_value_action.ts index 95e90ac04192b..57a41831406f9 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_set_value_action.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_set_value_action.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; export function createFormSetValueAction( testBed: TestBed, diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_action.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_action.ts index 6bf47f5d513f6..b2408583cc3aa 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_action.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_action.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; export const createFormToggleAction = (testBed: TestBed, dataTestSubject: string) => async () => { const { form, component } = testBed; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_and_set_value_action.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_and_set_value_action.ts index b3510466b4b90..a5c436b13ee0f 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_and_set_value_action.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/form_toggle_and_set_value_action.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { createFormToggleAction } from './form_toggle_action'; import { createFormSetValueAction } from './form_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/index_priority_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/index_priority_actions.ts index eeab42c408244..79fb77e53cc59 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/index_priority_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/index_priority_actions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; import { createFormToggleAction } from './form_toggle_action'; import { createFormToggleAndSetValueAction } from './form_toggle_and_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/min_age_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/min_age_actions.ts index 551474c8b16e6..ef00fdc8d7757 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/min_age_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/min_age_actions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; import { createFormSetValueAction } from './form_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/node_allocation_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/node_allocation_actions.ts index 7c0f8fea7299d..2a680590654a8 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/node_allocation_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/node_allocation_actions.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { DataTierAllocationType } from '../../../../public/application/sections/edit_policy/types'; import { Phase } from '../../../../common/types'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/phases.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/phases.ts index 7f07480cc248d..4bc223943c6c7 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/phases.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/phases.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { createForceMergeActions, createShrinkActions, diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/readonly_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/readonly_actions.ts index b76143eccf1f2..1a7ec56815b00 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/readonly_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/readonly_actions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; import { createFormToggleAction } from './form_toggle_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/replicas_action.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/replicas_action.ts index f987ce6d0ca2f..43eca26a4e1ce 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/replicas_action.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/replicas_action.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; import { createFormToggleAndSetValueAction } from './form_toggle_and_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/request_flyout_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/request_flyout_actions.ts index 87e66ea71e0e4..ca79d52741595 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/request_flyout_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/request_flyout_actions.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; const jsonSelector = 'policyRequestJson'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/rollover_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/rollover_actions.ts index 93a1b959ec969..683ba31843829 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/rollover_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/rollover_actions.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { createFormToggleAction } from './form_toggle_action'; import { createFormSetValueAction } from './form_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/save_policy_action.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/save_policy_action.ts index 3fcd1205b6e1a..9c27e38d75e0d 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/save_policy_action.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/save_policy_action.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; export const createSavePolicyAction = (testBed: TestBed) => async () => { const { find, component } = testBed; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/searchable_snapshot_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/searchable_snapshot_actions.ts index f1a64c3943511..3efffcddbece6 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/searchable_snapshot_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/searchable_snapshot_actions.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { Phase } from '../../../../common/types'; import { createFormToggleAction } from './form_toggle_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts index 394a64696d5eb..def20f73b82fe 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/shrink_actions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { Phase } from '../../../../common/types'; import { createFormSetValueAction } from './form_set_value_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/snapshot_policy_actions.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/snapshot_policy_actions.ts index 37e0ef17d2254..8aaf968560a1d 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/snapshot_policy_actions.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/snapshot_policy_actions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/target_types/jest'; +import type { TestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; const createSetWaitForSnapshotAction = (testBed: TestBed) => async (snapshotPolicyName: string) => { diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/toggle_phase_action.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/toggle_phase_action.ts index ce5b8b234e088..c22efae87d5ac 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/toggle_phase_action.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/actions/toggle_phase_action.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { Phase } from '../../../../common/types'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/extend_index_management.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/extend_index_management.test.tsx index a38c6e1af5c2a..240cc18fdc02d 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/extend_index_management.test.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/extend_index_management.test.tsx @@ -9,7 +9,7 @@ import moment from 'moment-timezone'; import axios from 'axios'; import axiosXhrAdapter from 'axios/lib/adapters/xhr'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { usageCollectionPluginMock } from '../../../../src/plugins/usage_collection/public/mocks'; import { Index } from '../common/types'; import { diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx index 1a45b2c6d93dc..3a1c2dd36812f 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx @@ -8,7 +8,7 @@ import moment from 'moment-timezone'; import React, { ReactElement } from 'react'; import { ReactWrapper } from 'enzyme'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { findTestSubject, takeMountedSnapshot } from '@elastic/eui/lib/test'; import { diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts index 79df6e8e9f20c..ba2dea966d8cb 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/index.ts @@ -7,8 +7,8 @@ import './mocks'; -export type { TestBed } from '@kbn/test/jest'; -export { nextTick, getRandomString, findTestSubject } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { nextTick, getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { setupEnvironment, diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts index e3184cadbdc49..e3295a8f4fb18 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts @@ -9,7 +9,12 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { EuiDescriptionListDescription } from '@elastic/eui'; -import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { + registerTestBed, + TestBed, + AsyncTestBedConfig, + findTestSubject, +} from '@kbn/test-jest-helpers'; import { DataStream } from '../../../common'; import { IndexManagementHome } from '../../../public/application/sections/home'; import { indexManagementStore } from '../../../public/application/store'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts index ad8aceb7d56b8..46287fcdcf074 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/home.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { IndexManagementHome } from '../../../public/application/sections/home'; import { indexManagementStore } from '../../../public/application/store'; import { WithAppDependencies, services, TestSubjects } from '../helpers'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts index 426bb11f3c733..60d4b7d3f2317 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/home.test.ts @@ -16,7 +16,7 @@ import { HomeTestBed, setup } from './home.helpers'; Could not load worker ReferenceError: Worker is not defined at createWorker (//node_modules/brace/index.js:17992:5) */ -import { stubWebWorker } from '@kbn/test/jest'; +import { stubWebWorker } from '@kbn/test-jest-helpers'; stubWebWorker(); describe('', () => { diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts index 4ddd14562577a..69dcabc287d6b 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/index_templates_tab.helpers.ts @@ -7,7 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { + registerTestBed, + TestBed, + AsyncTestBedConfig, + findTestSubject, +} from '@kbn/test-jest-helpers'; import { TemplateList } from '../../../public/application/sections/home/template_list'; import { TemplateDeserialized } from '../../../common'; import { WithAppDependencies, TestSubjects } from '../helpers'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts index 018025b25246b..719758e18525a 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.helpers.ts @@ -8,7 +8,12 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; -import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { + registerTestBed, + TestBed, + AsyncTestBedConfig, + findTestSubject, +} from '@kbn/test-jest-helpers'; import { IndexManagementHome } from '../../../public/application/sections/home'; import { indexManagementStore } from '../../../public/application/store'; import { WithAppDependencies, services, TestSubjects } from '../helpers'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts index 9e3f323ca45ea..6387a0904a69c 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts @@ -43,7 +43,7 @@ jest.mock('../../../public/application/lib/ace.js', () => { Could not load worker ReferenceError: Worker is not defined at createWorker (//node_modules/brace/index.js:17992:5) */ -import { stubWebWorker } from '@kbn/test/jest'; +import { stubWebWorker } from '@kbn/test-jest-helpers'; import { createMemoryHistory } from 'history'; stubWebWorker(); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts index dffa6fee19d06..9aec6cae7a17e 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_clone.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { TemplateClone } from '../../../public/application/sections/template_clone'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts index 450d2c524b445..b039fa83000ed 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { TemplateCreate } from '../../../public/application/sections/template_create'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts index 6c73da3b3379d..a7f87d828eb23 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { TemplateEdit } from '../../../public/application/sections/template_edit'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts index d14855354f0ad..57d0b282d351d 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; -import { TestBed, SetupFunc } from '@kbn/test/jest'; +import { TestBed, SetupFunc } from '@kbn/test-jest-helpers'; import { TemplateDeserialized } from '../../../common'; interface MappingField { diff --git a/x-pack/plugins/index_management/__jest__/components/index_table.test.js b/x-pack/plugins/index_management/__jest__/components/index_table.test.js index 5e5538fcca4e8..f98c891e5f4f5 100644 --- a/x-pack/plugins/index_management/__jest__/components/index_table.test.js +++ b/x-pack/plugins/index_management/__jest__/components/index_table.test.js @@ -19,7 +19,7 @@ import axiosXhrAdapter from 'axios/lib/adapters/xhr'; Could not load worker ReferenceError: Worker is not defined at createWorker (//node_modules/brace/index.js:17992:5) */ -import { mountWithIntl, stubWebWorker } from '@kbn/test/jest'; // eslint-disable-line no-unused-vars +import { mountWithIntl, stubWebWorker } from '@kbn/test-jest-helpers'; // eslint-disable-line no-unused-vars import { BASE_PATH, API_BASE_PATH } from '../../common/constants'; import { AppWithoutRouter } from '../../public/application/app'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts index 06f0036cc5c77..18b5bbfd775bb 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_create.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { BASE_PATH } from '../../../../../../../common'; import { ComponentTemplateCreate } from '../../../component_template_wizard'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts index 49bef82ce3d11..cdf376028ff1d 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { WithAppDependencies } from './setup_environment'; import { ComponentTemplateDetailsFlyoutContent } from '../../../component_template_details'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts index e7b8df245aaa9..6e0f9d55ef7f0 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { BASE_PATH } from '../../../../../../../common'; import { ComponentTemplateEdit } from '../../../component_template_wizard'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_form.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_form.helpers.ts index 578a124125107..ce97ac9d4e222 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_form.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_form.helpers.ts @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; interface MappingField { name: string; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts index 680550d16096b..2a01518e25466 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_list.helpers.ts @@ -13,7 +13,7 @@ import { AsyncTestBedConfig, findTestSubject, nextTick, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; import { BASE_PATH } from '../../../../../../../common'; import { WithAppDependencies } from './setup_environment'; import { ComponentTemplateList } from '../../../component_template_list/component_template_list'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/index.ts index 5185878ee98bc..72c3b8af534a5 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/index.ts @@ -8,7 +8,7 @@ import { setup as componentTemplatesListSetup } from './component_template_list.helpers'; import { setup as componentTemplateDetailsSetup } from './component_template_details.helpers'; -export { nextTick, getRandomString, findTestSubject } from '@kbn/test/jest'; +export { nextTick, getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { setupEnvironment, componentTemplatesDependencies } from './setup_environment'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/index.ts index d436492756659..5244cdb65bb0f 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/index.ts @@ -12,8 +12,8 @@ import { getMappingsEditorDataFactory, } from './mappings_editor.helpers'; -export type { TestBed } from '@kbn/test/jest'; -export { nextTick, getRandomString, findTestSubject } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { nextTick, getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { kibanaVersion } from './setup_environment'; export const componentHelpers = { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx index 074d96e9be4c1..1e3cfd99cedb4 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; -import { registerTestBed, TestBed, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, TestBed, findTestSubject } from '@kbn/test-jest-helpers'; // This import needs to come first as it sets the jest.mock calls import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.test.tsx index 8259c78b8e140..c2502f14facfb 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.test.tsx @@ -18,7 +18,7 @@ jest.mock('lodash', () => { }; }); -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { LoadMappingsProvider } from './load_mappings_provider'; const ComponentToTest = ({ onJson }: { onJson: () => void }) => ( diff --git a/x-pack/plugins/index_management/test/fixtures/template.ts b/x-pack/plugins/index_management/test/fixtures/template.ts index dd279cf4bcaec..ae9be96015735 100644 --- a/x-pack/plugins/index_management/test/fixtures/template.ts +++ b/x-pack/plugins/index_management/test/fixtures/template.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString, getRandomNumber } from '@kbn/test/jest'; +import { getRandomString, getRandomNumber } from '@kbn/test-jest-helpers'; import { TemplateDeserialized, TemplateType, TemplateListItem } from '../../common'; const objHasProperties = (obj?: Record): boolean => { diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx index c8cd2da45c5c3..d34f6b369b2df 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/expression.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { act } from 'react-dom/test-utils'; // We are using this inside a `jest.mock` call. Jest requires dynamic dependencies to be prefixed with `mock` diff --git a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.test.tsx b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.test.tsx index 3bbc3cb2662cb..e40c72171f72b 100644 --- a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.test.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; // We are using this inside a `jest.mock` call. Jest requires dynamic dependencies to be prefixed with `mock` import { coreMock as mockCoreMock } from 'src/core/public/mocks'; import React from 'react'; diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.test.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.test.tsx index 94192f9f911c5..309808bf48352 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.test.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import React from 'react'; import { act } from 'react-dom/test-utils'; // We are using this inside a `jest.mock` call. Jest requires dynamic dependencies to be prefixed with `mock` diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.test.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.test.tsx index f7e3201bbf2c9..e5c6e1a4d8984 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.test.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.test.tsx @@ -6,7 +6,7 @@ */ import { DataViewBase } from '@kbn/es-query'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import React from 'react'; import { act } from 'react-dom/test-utils'; // We are using this inside a `jest.mock` call. Jest requires dynamic dependencies to be prefixed with `mock` diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.test.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.test.tsx index 1d8c6f6339878..6a0de2481e64a 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.test.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import React from 'react'; import { act } from 'react-dom/test-utils'; import { Comparator } from '../../../../common/alerting/metrics'; diff --git a/x-pack/plugins/infra/public/containers/logs/log_view_configuration.test.tsx b/x-pack/plugins/infra/public/containers/logs/log_view_configuration.test.tsx index f30878dd2ff3d..1fe14d9b2965b 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_view_configuration.test.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_view_configuration.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountHook } from '@kbn/test/jest'; +import { mountHook } from '@kbn/test-jest-helpers'; import { useLogViewConfiguration } from './log_view_configuration'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/metrics_time.test.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/metrics_time.test.tsx index c16314a6c0e71..5260cd4d680f6 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/metrics_time.test.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/metrics_time.test.tsx @@ -8,7 +8,7 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Router } from 'react-router-dom'; -import { mountHook } from '@kbn/test/jest'; +import { mountHook } from '@kbn/test-jest-helpers'; import { ScopedHistory } from '../../../../../../../../src/core/public'; import { useMetricsTime } from './use_metrics_time'; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/index.ts index ed88156b740bf..5f4dc01fa924a 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/index.ts @@ -11,7 +11,7 @@ import { setup as pipelinesCloneSetup } from './pipelines_clone.helpers'; import { setup as pipelinesEditSetup } from './pipelines_edit.helpers'; import { setup as pipelinesCreateFromCsvSetup } from './pipelines_create_from_csv.helpers'; -export { nextTick, getRandomString, findTestSubject } from '@kbn/test/jest'; +export { nextTick, getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { setupEnvironment } from './setup_environment'; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts index 3f11f9538ffa9..432b9046f1071 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; export const getFormActions = (testBed: TestBed) => { const { find, form, component } = testBed; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts index 51f6d9bd96bd6..5b5d6704e9001 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test-jest-helpers'; import { PipelinesClone } from '../../../public/application/sections/pipelines_clone'; import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts index faf1b42042ec1..3dc97cf121b98 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test-jest-helpers'; import { PipelinesCreate } from '../../../public/application/sections/pipelines_create'; import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts index e7de57de0e948..ea9d623e216b2 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { PipelinesCreateFromCsv } from '../../../public/application/sections/pipelines_create_from_csv'; import { WithAppDependencies } from './setup_environment'; import { getCreateFromCsvPath, ROUTES } from '../../../public/application/services/navigation'; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts index 9a3c41196653f..74d124de885ff 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig, TestBed } from '@kbn/test-jest-helpers'; import { PipelinesEdit } from '../../../public/application/sections/pipelines_edit'; import { getFormActions, PipelineFormTestSubjects } from './pipeline_form.helpers'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts index e2d9f1f8bf5f9..6fa3a7a9473fe 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts @@ -7,7 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { + registerTestBed, + TestBed, + AsyncTestBedConfig, + findTestSubject, +} from '@kbn/test-jest-helpers'; import { PipelinesList } from '../../../public/application/sections/pipelines_list'; import { WithAppDependencies } from './setup_environment'; import { getListPath, ROUTES } from '../../../public/application/services/navigation'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx index 79ffd28c9e788..dd269e34fa694 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx @@ -8,7 +8,7 @@ import { act } from 'react-dom/test-utils'; import React from 'react'; -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { Props } from '../'; import { ProcessorsEditorWithDeps } from './processors_editor'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx index 65d9b8f306058..274d41651fe91 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx @@ -13,8 +13,8 @@ import axiosXhrAdapter from 'axios/lib/adapters/xhr'; /* eslint-disable @kbn/eslint/no-restricted-paths */ import { usageCollectionPluginMock } from 'src/plugins/usage_collection/public/mocks'; -import { registerTestBed, TestBed } from '@kbn/test/jest'; -import { stubWebWorker } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; +import { stubWebWorker } from '@kbn/test-jest-helpers'; import { uiMetricService, apiService } from '../../../../services'; import { Props } from '../../'; import { initHttpRequests } from '../http_requests.helpers'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx index 263a40a605d2d..ff8802a91cc9b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx @@ -13,8 +13,8 @@ import axiosXhrAdapter from 'axios/lib/adapters/xhr'; /* eslint-disable-next-line @kbn/eslint/no-restricted-paths */ import { usageCollectionPluginMock } from 'src/plugins/usage_collection/public/mocks'; -import { registerTestBed, TestBed } from '@kbn/test/jest'; -import { stubWebWorker } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; +import { stubWebWorker } from '@kbn/test-jest-helpers'; /* eslint-disable-next-line @kbn/eslint/no-restricted-paths */ import '../../../../../../../../src/plugins/es_ui_shared/public/components/code_editor/jest_mock'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx index 74b759fc80375..9392fe2398e2f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx @@ -18,7 +18,7 @@ jest.mock('lodash', () => { }; }); -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; const setup = ({ onDone }: { onDone: OnDoneLoadJsonHandler }) => { return registerTestBed( diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/cell_value.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/cell_value.test.tsx index 21f6cb6bc2052..7cd45dffd5def 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/cell_value.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/cell_value.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { DataContext } from './table_basic'; import { createGridCell } from './cell_value'; diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx index 22f5227baa556..d8dabd81441da 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.test.tsx @@ -10,7 +10,7 @@ import { EuiButtonGroup, EuiComboBox, EuiFieldText } from '@elastic/eui'; import { FramePublicAPI, Operation, VisualizationDimensionEditorProps } from '../../types'; import { DatatableVisualizationState } from '../visualization'; import { createMockDatasource, createMockFramePublicAPI } from '../../mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TableDimensionEditor } from './dimension_editor'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { PaletteRegistry } from 'src/plugins/charts/public'; diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx index c01419cc2a91e..8c75ee9efcc6b 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ReactWrapper, shallow, mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EuiDataGrid } from '@elastic/eui'; import { IAggType } from 'src/plugins/data/public'; import { diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx index 35e5c81cb72c4..6bc27808c7c0c 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx @@ -6,7 +6,7 @@ */ import React, { FormEvent } from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DataTableToolbar } from './toolbar'; import { DatatableVisualizationState } from '../visualization'; import { FramePublicAPI, VisualizationToolbarProps } from '../../types'; diff --git a/x-pack/plugins/lens/public/debounced_component/debounced_component.test.tsx b/x-pack/plugins/lens/public/debounced_component/debounced_component.test.tsx index 6beb565be098c..d52eb3c578059 100644 --- a/x-pack/plugins/lens/public/debounced_component/debounced_component.test.tsx +++ b/x-pack/plugins/lens/public/debounced_component/debounced_component.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl as mount } from '@kbn/test/jest'; +import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { debouncedComponent } from './debounced_component'; import { act } from 'react-dom/test-utils'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx index 7fe115847b2b5..03dc83d030838 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx @@ -17,7 +17,7 @@ import { NoFieldsCallout } from './no_fields_callout'; import { act } from 'react-dom/test-utils'; import { coreMock } from 'src/core/public/mocks'; import { IndexPatternPrivateState } from './types'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { ChangeIndexPattern } from './change_indexpattern'; import { EuiProgress, EuiLoadingSpinner } from '@elastic/eui'; import { documentField } from './document_field'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index 975e08e5ca1a9..d8121e4b726be 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -21,7 +21,7 @@ import { IndexPatternDimensionEditorComponent, IndexPatternDimensionEditorProps, } from './dimension_panel'; -import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test/jest'; +import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { IUiSettingsClient, SavedObjectsClientContract, HttpSetup, CoreSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import { generateId } from '../../id_generator'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx index 4a16739e65972..5131a1224341e 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/reference_editor.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { ReactWrapper, ShallowWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { EuiComboBox } from '@elastic/eui'; -import { mountWithIntl as mount } from '@kbn/test/jest'; +import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import type { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import type { DataPublicPluginStart } from 'src/plugins/data/public'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.test.tsx index cb721416a1df9..c86fdcc33b15f 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.test.tsx @@ -11,7 +11,7 @@ import { act } from 'react-dom/test-utils'; import { EuiLoadingSpinner, EuiPopover } from '@elastic/eui'; import { InnerFieldItem, FieldItemProps } from './field_item'; import { coreMock } from 'src/core/public/mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; import { IndexPattern } from './types'; import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.test.tsx index b3ade3ebc48b8..b886cc5539d40 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiLoadingSpinner, EuiNotificationBadge } from '@elastic/eui'; import { coreMock } from 'src/core/public/mocks'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; import { IndexPattern } from './types'; import { FieldItem } from './field_item'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.test.tsx index 335796442bd8b..91b9de58bdaa1 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { IndexPatternPrivateState } from './types'; import { IndexPatternLayerPanelProps, LayerPanel } from './layerpanel'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { ShallowWrapper } from 'enzyme'; import { EuiSelectable } from '@elastic/eui'; import { ChangeIndexPattern } from './change_indexpattern'; diff --git a/x-pack/plugins/lens/public/metric_visualization/dimension_editor.test.tsx b/x-pack/plugins/lens/public/metric_visualization/dimension_editor.test.tsx index ef0687a2cd519..b296313086d7f 100644 --- a/x-pack/plugins/lens/public/metric_visualization/dimension_editor.test.tsx +++ b/x-pack/plugins/lens/public/metric_visualization/dimension_editor.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiButtonGroup } from '@elastic/eui'; import { FramePublicAPI, VisualizationDimensionEditorProps } from '../types'; import { createMockDatasource, createMockFramePublicAPI } from '../mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { MetricDimensionEditor } from './dimension_editor'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { ColorMode, PaletteOutput, PaletteRegistry } from 'src/plugins/charts/public'; diff --git a/x-pack/plugins/lens/public/mocks/store_mocks.tsx b/x-pack/plugins/lens/public/mocks/store_mocks.tsx index 1b1d83ef2892d..3365657fea34e 100644 --- a/x-pack/plugins/lens/public/mocks/store_mocks.tsx +++ b/x-pack/plugins/lens/public/mocks/store_mocks.tsx @@ -9,7 +9,7 @@ import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies import { ReactWrapper } from 'enzyme'; // eslint-disable-next-line import/no-extraneous-dependencies -import { mountWithIntl as mount } from '@kbn/test/jest'; +import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { Provider } from 'react-redux'; import { act } from 'react-dom/test-utils'; import { PreloadedState } from '@reduxjs/toolkit'; diff --git a/x-pack/plugins/lens/public/pie_visualization/get_legend_action.test.tsx b/x-pack/plugins/lens/public/pie_visualization/get_legend_action.test.tsx index 91886c6cf19d6..df0648aa40d74 100644 --- a/x-pack/plugins/lens/public/pie_visualization/get_legend_action.test.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/get_legend_action.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { LegendActionProps, SeriesIdentifier } from '@elastic/charts'; import { EuiPopover } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ComponentType, ReactWrapper } from 'enzyme'; import type { Datatable } from 'src/plugins/expressions/public'; import { getLegendAction } from './get_legend_action'; diff --git a/x-pack/plugins/lens/public/shared_components/axis_title_settings.test.tsx b/x-pack/plugins/lens/public/shared_components/axis_title_settings.test.tsx index 4cb7f6d1314b6..433a0f821f273 100644 --- a/x-pack/plugins/lens/public/shared_components/axis_title_settings.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/axis_title_settings.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { AxisTitleSettings, AxisTitleSettingsProps } from './axis_title_settings'; describe('Axes Title settings', () => { diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/color_ranges.test.tsx b/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/color_ranges.test.tsx index 3010c9fcc47e9..aafcc3fce8dde 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/color_ranges.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_ranges/color_ranges.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { act } from 'react-dom/test-utils'; import { ColorRanges, ColorRangesProps } from './color_ranges'; diff --git a/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx b/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx index a97f3d3f04112..cb7ce91b84aeb 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiButtonGroup, EuiColorPalettePickerPaletteProps } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import type { PaletteOutput, PaletteRegistry } from 'src/plugins/charts/public'; import { ReactWrapper } from 'enzyme'; diff --git a/x-pack/plugins/lens/public/shared_components/legend_location_settings.test.tsx b/x-pack/plugins/lens/public/shared_components/legend_location_settings.test.tsx index 0c494f4d0090d..49a53c1abf66f 100644 --- a/x-pack/plugins/lens/public/shared_components/legend_location_settings.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/legend_location_settings.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { Position } from '@elastic/charts'; -import { shallowWithIntl as shallow, mountWithIntl as mount } from '@kbn/test/jest'; +import { shallowWithIntl as shallow, mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { LegendLocationSettings, LegendLocationSettingsProps } from './legend_location_settings'; describe('Legend Location Settings', () => { diff --git a/x-pack/plugins/lens/public/shared_components/legend_settings_popover.test.tsx b/x-pack/plugins/lens/public/shared_components/legend_settings_popover.test.tsx index 95739c294b320..0072a6cd2dcce 100644 --- a/x-pack/plugins/lens/public/shared_components/legend_settings_popover.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/legend_settings_popover.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { LegendSettingsPopover, LegendSettingsPopoverProps, diff --git a/x-pack/plugins/lens/public/shared_components/value_labels_settings.test.tsx b/x-pack/plugins/lens/public/shared_components/value_labels_settings.test.tsx index ae68a40d8cea6..7f5ebcf7aa281 100644 --- a/x-pack/plugins/lens/public/shared_components/value_labels_settings.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/value_labels_settings.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { ValueLabelsSettings, VisualOptionsProps } from './value_labels_settings'; describe('Value labels Settings', () => { diff --git a/x-pack/plugins/lens/public/visualizations/gauge/toolbar_component/gauge_toolbar.test.tsx b/x-pack/plugins/lens/public/visualizations/gauge/toolbar_component/gauge_toolbar.test.tsx index 93d9eb04775ea..1c3a5fdea5593 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/toolbar_component/gauge_toolbar.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/toolbar_component/gauge_toolbar.test.tsx @@ -6,7 +6,7 @@ */ import React, { FormEvent } from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ToolbarButton } from 'src/plugins/kibana_react/public'; import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx index 027165a2eb5d0..bc57547bc0ee6 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx @@ -43,7 +43,7 @@ import { Datatable, DatatableRow } from '../../../../../src/plugins/expressions/ import React from 'react'; import { shallow } from 'enzyme'; import { createMockExecutionContext } from '../../../../../src/plugins/expressions/common/mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; import { EmptyPlaceholder } from '../../../../../src/plugins/charts/public'; import { XyEndzones } from './x_domain'; diff --git a/x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx b/x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx index 5d1b45e481499..c15c0916bee0b 100644 --- a/x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { LegendActionProps, SeriesIdentifier } from '@elastic/charts'; import { EuiPopover } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ComponentType, ReactWrapper } from 'enzyme'; import type { LensMultiTable } from '../../common'; import { layerTypes } from '../../common'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.test.tsx index 81e82bd1fb904..a57298787b2e3 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { AxisSettingsPopover, AxisSettingsPopoverProps } from './axis_settings_popover'; import { ToolbarPopover } from '../../shared_components'; import { layerTypes } from '../../../common'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fill_opacity_option.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fill_opacity_option.test.tsx index 3ba29e4f72c83..f9920647478be 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fill_opacity_option.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fill_opacity_option.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test/jest'; +import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { EuiRange } from '@elastic/eui'; import { FillOpacityOption } from './fill_opacity_option'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.test.tsx index c37a36a42fa47..272adc3b17f05 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test/jest'; +import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { EuiSwitch } from '@elastic/eui'; import { LineCurveOption } from './line_curve_option'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_value_option.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_value_option.test.tsx index ce4e05223b5a3..d3960acd56377 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_value_option.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_value_option.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow, mountWithIntl as mount } from '@kbn/test/jest'; +import { shallowWithIntl as shallow, mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { EuiSuperSelect } from '@elastic/eui'; import { MissingValuesOptions } from './missing_values_option'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx index 6b48738e22a60..fe8a71ad9f326 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl as shallow } from '@kbn/test/jest'; +import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { Position } from '@elastic/charts'; import type { FramePublicAPI } from '../../../types'; import { createMockDatasource, createMockFramePublicAPI } from '../../../mocks'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx index e5b1870c73404..0ffa2d394bcaf 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test/jest'; +import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { EuiButtonGroupProps, EuiButtonGroup } from '@elastic/eui'; import { LayerContextMenu, XyToolbar, DimensionEditor } from '.'; import { AxisSettingsPopover } from './axis_settings_popover'; diff --git a/x-pack/plugins/license_management/__jest__/upload_license.test.tsx b/x-pack/plugins/license_management/__jest__/upload_license.test.tsx index a5f6a866bc9de..62b7dbf6c1a78 100644 --- a/x-pack/plugins/license_management/__jest__/upload_license.test.tsx +++ b/x-pack/plugins/license_management/__jest__/upload_license.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { LocationDescriptorObject } from 'history'; import { httpServiceMock, scopedHistoryMock } from '../../../../src/core/public/mocks'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; // @ts-ignore import { uploadLicense } from '../public/application/store/actions/upload_license'; diff --git a/x-pack/plugins/license_management/__jest__/util/util.js b/x-pack/plugins/license_management/__jest__/util/util.js index eacd397d60016..25ef77612ca2c 100644 --- a/x-pack/plugins/license_management/__jest__/util/util.js +++ b/x-pack/plugins/license_management/__jest__/util/util.js @@ -10,7 +10,7 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { httpServiceMock, scopedHistoryMock } from '../../../../../src/core/public/mocks'; import { licenseManagementStore } from '../../public/application/store/store'; import { AppContextProvider } from '../../public/application/app_context'; diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.test.js index b9f4c6d707a3b..32103896134ad 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import 'brace'; import { PipelineEditor } from './pipeline_editor'; diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.test.js index 398310e72be02..a99f8ce5519f5 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { AddRoleAlert } from './add_role_alert'; describe('AddRoleAlert component', () => { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.test.js index a8ee367e8d36f..7889a91f925f9 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { AlertCallOut } from './alert_call_out'; describe('AlertCallOut component', () => { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.test.js index 3d7babb95eeb9..9186d8138c094 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { ConfirmDeleteModal } from './confirm_delete_modal'; describe('ConfirmDeleteModal component', () => { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.test.js index 13db9e6e73e60..2f0a707d880c2 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { EnableMonitoringAlert } from './enable_monitoring_alert'; describe('EnableMonitoringAlert component', () => { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.test.js index fb8a5e2a627c7..620e8081c6744 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { PipelineList } from './pipeline_list'; describe('PipelineList component', () => { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.test.js index 38213733d5e72..79c49319bfb45 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.test.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { PipelinesTable } from './pipelines_table'; describe('PipelinesTable component', () => { diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotation_description_list/index.test.tsx b/x-pack/plugins/ml/public/application/components/annotations/annotation_description_list/index.test.tsx index 430b56b4b52b9..bb9fa3a8ec4d6 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotation_description_list/index.test.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/annotation_description_list/index.test.tsx @@ -9,7 +9,7 @@ import mockAnnotations from '../annotations_table/__mocks__/mock_annotations.jso import moment from 'moment-timezone'; import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { AnnotationDescriptionList } from './index'; diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.test.js b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.test.js index 0caf92baca88d..1681d151cd31f 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.test.js +++ b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.test.js @@ -8,7 +8,7 @@ import jobConfig from '../../../../../common/types/__mocks__/job_config_farequote'; import mockAnnotations from './__mocks__/mock_annotations.json'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { AnnotationsTable } from './annotations_table'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.test.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.test.js index 668d392bffbbe..67f6a9b12dfa1 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.test.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { AnomalyDetails } from './anomaly_details'; const props = { diff --git a/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.test.tsx b/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.test.tsx index efe405044f45e..d726356624b35 100644 --- a/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.test.tsx +++ b/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EntityCell } from './entity_cell'; const defaultProps = { diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx index 3f64ff794d9ab..ea444193db0b1 100644 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx +++ b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { FullTimeRangeSelector } from './index'; import type { Query } from 'src/plugins/data/public'; import type { DataView } from '../../../../../../../src/plugins/data_views/public'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.test.js index 149cdf9bb9aa0..37315b61c2d02 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ActionsSection } from './actions_section'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.test.js index f4752f5407370..1c979525ca9eb 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { DetectorDescriptionList } from './detector_description_list'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.test.js index f13b2d010a370..2fbf69c67f26a 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.test.js @@ -8,7 +8,7 @@ // Mock the mlJobService that is imported for saving rules. jest.mock('../../services/job_service.js', () => 'mlJobService'); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ConditionExpression } from './condition_expression'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.test.js index eaa352b33253d..69a71dda38cb4 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.test.js @@ -8,7 +8,7 @@ // Mock the mlJobService that is imported for saving rules. jest.mock('../../services/job_service.js', () => 'mlJobService'); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ConditionsSection } from './conditions_section'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js index 20a66bcf5b140..2553baa11da33 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js @@ -56,7 +56,7 @@ jest.mock('../../../../../../../src/plugins/kibana_react/public', () => ({ }, })); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { RuleEditorFlyout } from './rule_editor_flyout'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.test.js index 59e5000dee7fd..c030dcfa1f0a4 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.test.js @@ -8,7 +8,7 @@ // Mock the mlJobService that is imported for saving rules. jest.mock('../../services/job_service.js', () => 'mlJobService'); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ScopeExpression } from './scope_expression'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.test.js index 5a9c6bb3af4cd..86a777f65a338 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.test.js @@ -16,7 +16,7 @@ jest.mock('../../capabilities/check_capabilities', () => ({ checkPermission: (privilege) => mockCheckPermission(privilege), })); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ScopeSection } from './scope_section'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.test.js index 802cd51575c78..2c255728f2eb3 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { AddToFilterListLink } from './add_to_filter_list_link'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.test.js index cf06149b728b0..457a552bad6c9 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { DeleteRuleModal } from './delete_rule_modal'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.test.js index 80b77e41a6964..9ae947c404c2e 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.test.js @@ -7,7 +7,7 @@ jest.mock('../../../services/job_service.js', () => 'mlJobService'); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EditConditionLink } from './edit_condition_link'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js index d4d93506a4d9d..7df277ae0b6ab 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js @@ -29,7 +29,7 @@ jest.mock('../../../services/ml_api_service', () => ({ }, })); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { RuleActionPanel } from './rule_action_panel'; diff --git a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.test.js b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.test.js index 8ec83d8679e87..b1755660960ad 100644 --- a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.test.js +++ b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ValidateJob } from './validate_job_view'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.test.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.test.tsx index f848aaf716641..36cc01d4462b9 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.test.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountHook } from '@kbn/test/jest'; +import { mountHook } from '@kbn/test-jest-helpers'; import { MlContext } from '../../../../../contexts/ml'; import { kibanaContextValueMock } from '../../../../../contexts/ml/__mocks__/kibana_context_value'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.test.js index 8f089ab8c07ce..8e39120e36411 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_distribution.test.js @@ -13,7 +13,7 @@ jest.mock('../../services/field_format_service', () => ({ }, })); -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ExplorerChartDistribution } from './explorer_chart_distribution'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_info_tooltip.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_info_tooltip.test.js index ef0482806f423..c2149097c8733 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_info_tooltip.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_info_tooltip.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ExplorerChartInfoTooltip } from './explorer_chart_info_tooltip'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_single_metric.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_single_metric.test.js index 133ca3e8eb628..2582dcfb05c16 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_single_metric.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_single_metric.test.js @@ -13,7 +13,7 @@ jest.mock('../../services/field_format_service', () => ({ }, })); -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ExplorerChartSingleMetric } from './explorer_chart_single_metric'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.test.js index 302dc63da7e52..e5c66bcdd59bd 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { CalendarForm } from './calendar_form'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.test.js index a2341edf38f58..d45d93043e16b 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EventsTable } from './events_table'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.test.js index 10bc1c7a96601..bcbbdec7b65c6 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ImportModal } from './import_modal'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.test.js index 5604ef4046240..8762cb4603807 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ImportedEvents } from './imported_events'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js index 0107af3cf8c1e..73391f3cba87f 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js @@ -67,7 +67,7 @@ jest.mock('../../../../../../../../src/plugins/kibana_react/public', () => ({ }, })); -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { NewCalendar } from './new_calendar'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.test.js index f33879bfa872f..0aa91a44458e7 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { NewEventModal } from './new_event_modal'; import moment from 'moment'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js index 8e66dbd274273..ee1879a8a3c7a 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ml } from '../../../services/ml_api_service'; import { CalendarsList } from './calendars_list'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/header.test.js b/x-pack/plugins/ml/public/application/settings/calendars/list/header.test.js index edbee43151f21..da470441caa98 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/header.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/header.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { CalendarsListHeader } from './header'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.test.js b/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.test.js index 543ae2b85abfc..13e2c1e2dc37b 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { CalendarsListTable } from './table'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.test.js index b4d32c387d183..0bbb3f443f1ae 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { AddItemPopover } from './add_item_popover'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.test.js index 65fc96a62a9cb..d46de282c59d9 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.test.js @@ -14,7 +14,7 @@ jest.mock('../../../../capabilities/check_capabilities', () => ({ })); jest.mock('../../../../services/ml_api_service', () => 'ml'); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { DeleteFilterListModal } from './delete_filter_list_modal'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.test.js index 6082a2bbf6799..ed6ae3764fd2a 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EditDescriptionPopover } from './edit_description_popover'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js index 09c37c724b7c9..c20b8485b7cd1 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js @@ -51,7 +51,7 @@ jest.mock('../../../../../../../../src/plugins/kibana_react/public', () => ({ }, })); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EditFilterList } from './edit_filter_list'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.test.js index dc756fb4686bb..039acc0bef1eb 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EditFilterListHeader } from './header'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.test.js index 83226ad236a6d..7935b7dce3185 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EditFilterListToolbar } from './toolbar'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js index 0ae4a758278f1..e6a69e971a864 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { FilterLists } from './filter_lists'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.test.js index 204cb6036afd3..4357dad093dad 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { FilterListsHeader } from './header'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.test.js index 164d4d7eecbd4..add92b804ee39 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.test.js @@ -12,7 +12,7 @@ jest.mock('../../../capabilities/check_capabilities', () => ({ })); jest.mock('../../../services/ml_api_service', () => 'ml'); -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { FilterListsTable } from './table'; diff --git a/x-pack/plugins/ml/public/application/settings/settings.test.tsx b/x-pack/plugins/ml/public/application/settings/settings.test.tsx index a12e733631830..ad3847e011371 100644 --- a/x-pack/plugins/ml/public/application/settings/settings.test.tsx +++ b/x-pack/plugins/ml/public/application/settings/settings.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { AnomalyDetectionSettingsContext } from './anomaly_detection_settings_context'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js index 4faae22f98153..850a585509003 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js @@ -8,7 +8,7 @@ //import mockOverallSwimlaneData from './__mocks__/mock_overall_swimlane.json'; import moment from 'moment-timezone'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { TimeseriesChart } from './timeseries_chart'; diff --git a/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx b/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx index a95eedb2b4cb1..ff58887c88c12 100644 --- a/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx +++ b/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx @@ -10,7 +10,7 @@ */ import React, { Fragment, lazy } from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { ReactWrapper, mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/helpers.test.js b/x-pack/plugins/monitoring/public/components/cluster/overview/helpers.test.js index 47cc1bef53caa..942065263912d 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/helpers.test.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/helpers.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { BytesUsage, BytesPercentageUsage } from './helpers'; describe('Bytes Usage', () => { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.test.js b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.test.js index 250b9f6391221..f2ef0484928fc 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.test.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { MetricCell } from './cells'; describe('Node Listing Metric Cell', () => { diff --git a/x-pack/plugins/monitoring/public/components/no_data/checker_errors.test.js b/x-pack/plugins/monitoring/public/components/no_data/checker_errors.test.js index d293494fcd4c4..1c33f68458fd0 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/checker_errors.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/checker_errors.test.js @@ -7,7 +7,7 @@ import React from 'react'; import { boomify, forbidden } from '@hapi/boom'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { CheckerErrors } from './checker_errors'; describe('CheckerErrors', () => { diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.test.js index b66793d840ebb..95dc62abdf9d2 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ExplainCollectionEnabled } from './collection_enabled'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.test.js index a5af179a050b7..95ffad81b902d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ExplainCollectionInterval } from './collection_interval'; import { findTestSubject } from '@elastic/eui/lib/test'; diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.test.js index 9958c6671d30b..47dbf5f1ab586 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { ExplainExporters, ExplainExportersCloud } from './exporters'; jest.mock('../../../../legacy_shims', () => ({ diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.test.js index c28c7563e5974..dd57cd3bd1c50 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { ExplainPluginEnabled } from './plugin_enabled'; describe('ExplainPluginEnabled', () => { diff --git a/x-pack/plugins/monitoring/public/components/no_data/no_data.test.js b/x-pack/plugins/monitoring/public/components/no_data/no_data.test.js index 17ee5148e5d11..a522d01037603 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/no_data.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/no_data.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { NoData } from '.'; const enabler = {}; diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.test.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.test.js index 6cec326109308..96b0ceb4cb83d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { ReasonFound } from '.'; jest.mock('../../../legacy_shims', () => ({ diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.test.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.test.js index 186676776021e..5fd3947c3bb1c 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { WeTried } from '.'; describe('WeTried', () => { diff --git a/x-pack/plugins/monitoring/public/components/page_loading/page_loading.test.js b/x-pack/plugins/monitoring/public/components/page_loading/page_loading.test.js index f7973231f41b0..07e3e89dce9a1 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/page_loading.test.js +++ b/x-pack/plugins/monitoring/public/components/page_loading/page_loading.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { PageLoading } from '.'; describe('PageLoading', () => { diff --git a/x-pack/plugins/monitoring/public/components/summary_status/summary_status.test.js b/x-pack/plugins/monitoring/public/components/summary_status/summary_status.test.js index 1428418ad3705..dcb4821e1819a 100644 --- a/x-pack/plugins/monitoring/public/components/summary_status/summary_status.test.js +++ b/x-pack/plugins/monitoring/public/components/summary_status/summary_status.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { SummaryStatus } from './summary_status'; describe('Summary Status Component', () => { diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.helpers.tsx b/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.helpers.tsx index a47e6c023a161..a4debdc6ae964 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.helpers.tsx +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.helpers.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { RemoteClusterAdd } from '../../../public/application/sections'; import { createRemoteClustersStore } from '../../../public/application/store'; diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.test.ts b/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.test.ts index 0727bc0c9ba2d..28332f71ca6ac 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.test.ts +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/add/remote_clusters_add.test.ts @@ -6,7 +6,7 @@ */ import { SinonFakeServer } from 'sinon'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { setupEnvironment, RemoteClustersActions } from '../helpers'; diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.helpers.tsx b/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.helpers.tsx index 2259396bf33f2..86f75c12424e7 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.helpers.tsx +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.helpers.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBedConfig } from '@kbn/test-jest-helpers'; import React from 'react'; import { RemoteClusterEdit } from '../../../public/application/sections'; diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.test.tsx b/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.test.tsx index 2913de94bc2dd..47aac3f924b96 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.test.tsx +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/edit/remote_clusters_edit.test.tsx @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { RemoteClusterForm } from '../../../public/application/sections/components/remote_cluster_form'; import { RemoteClustersActions, setupEnvironment } from '../helpers'; diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/index.ts index 4cfe1fb41a835..b2a7e2d90dc64 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -export { nextTick, getRandomString, findTestSubject } from '@kbn/test/jest'; +export { nextTick, getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { setupEnvironment } from './setup_environment'; export type { RemoteClustersActions } from './remote_clusters_actions'; export { createRemoteClustersActions } from './remote_clusters_actions'; diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/remote_clusters_actions.ts b/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/remote_clusters_actions.ts index ba0c424793838..3a2d4be3e060d 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/remote_clusters_actions.ts +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/helpers/remote_clusters_actions.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed } from '@kbn/test/jest'; +import { TestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; export interface RemoteClustersActions { docsButtonExists: () => boolean; diff --git a/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.helpers.js b/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.helpers.js index d05ddbd1800e4..9aeef5d684f3f 100644 --- a/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.helpers.js +++ b/x-pack/plugins/remote_clusters/__jest__/client_integration/list/remote_clusters_list.helpers.js @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject } from '@kbn/test/jest'; +import { registerTestBed, findTestSubject } from '@kbn/test-jest-helpers'; import { RemoteClusterList } from '../../../public/application/sections/remote_cluster_list'; import { createRemoteClustersStore } from '../../../public/application/store'; diff --git a/x-pack/plugins/remote_clusters/fixtures/remote_cluster.js b/x-pack/plugins/remote_clusters/fixtures/remote_cluster.js index d6bbe99f7b5d7..d750636b76234 100644 --- a/x-pack/plugins/remote_clusters/fixtures/remote_cluster.js +++ b/x-pack/plugins/remote_clusters/fixtures/remote_cluster.js @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; import { SNIFF_MODE } from '../common/constants'; diff --git a/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx b/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx index 3030994c5ed32..3200a3305ebcd 100644 --- a/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx +++ b/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { Observable } from 'rxjs'; import { SerializableRecord } from '@kbn/utility-types'; diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx index ef3e9940238c1..82dfe8e167dfa 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { httpServiceMock, notificationServiceMock, diff --git a/x-pack/plugins/rollup/fixtures/job.js b/x-pack/plugins/rollup/fixtures/job.js index 53c63e14c96cc..d0086d134c60b 100644 --- a/x-pack/plugins/rollup/fixtures/job.js +++ b/x-pack/plugins/rollup/fixtures/job.js @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; const initialValues = { dateHistogramField: 'timestamp', diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js index e1f9ec2b3a315..fa63639ef4d06 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { getJob } from '../../../../../fixtures'; import { rollupJobsStore } from '../../../store'; import { DetailPanel } from './detail_panel'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js index b2c738a033b3c..ba82e3b9b9f5e 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { rollupJobsStore } from '../../store'; import { JobList } from './job_list'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js index d52f3fa35a544..d9fbf796c64d6 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js @@ -7,7 +7,7 @@ import { Pager } from '@elastic/eui'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { getJobs, jobCount } from '../../../../../fixtures'; import { rollupJobsStore } from '../../../store'; import { JobTable } from './job_table'; diff --git a/x-pack/plugins/rollup/public/test/client_integration/helpers/index.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/index.js index ef5a191b994c6..c897eed6c477e 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/helpers/index.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/index.js @@ -11,7 +11,7 @@ import { setup as jobCreateSetup } from './job_create.helpers'; import { setup as jobListSetup } from './job_list.helpers'; import { setup as jobCloneSetup } from './job_clone.helpers'; -export { getRandomString, findTestSubject } from '@kbn/test/jest'; +export { getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { wrapComponent } from './setup_context'; diff --git a/x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js index d81bdd3093300..613980868edbe 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { createRollupJobsStore } from '../../../crud_app/store'; import { JobCreate } from '../../../crud_app/sections'; import { JOB_TO_CLONE } from './constants'; diff --git a/x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js index 36550d904fa39..92eb2bf62cc2f 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js @@ -7,7 +7,7 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { rollupJobsStore } from '../../../crud_app/store'; import { JobCreate } from '../../../crud_app/sections'; diff --git a/x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js index f4c59334b8875..5f64e0cfe34bf 100644 --- a/x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { registerRouter } from '../../../crud_app/services'; import { createRollupJobsStore } from '../../../crud_app/store'; import { JobList } from '../../../crud_app/sections/job_list'; diff --git a/x-pack/plugins/runtime_fields/public/test_utils.ts b/x-pack/plugins/runtime_fields/public/test_utils.ts index 1c052cd666e56..637ef68b1726d 100644 --- a/x-pack/plugins/runtime_fields/public/test_utils.ts +++ b/x-pack/plugins/runtime_fields/public/test_utils.ts @@ -5,5 +5,5 @@ * 2.0. */ -export type { TestBed } from '@kbn/test/jest'; -export { registerTestBed } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { registerTestBed } from '@kbn/test-jest-helpers'; diff --git a/x-pack/plugins/searchprofiler/public/application/components/empty_tree_placeholder/empty_tree_placeholder.test.tsx b/x-pack/plugins/searchprofiler/public/application/components/empty_tree_placeholder/empty_tree_placeholder.test.tsx index 91fda67046f93..007786722ca52 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/empty_tree_placeholder/empty_tree_placeholder.test.tsx +++ b/x-pack/plugins/searchprofiler/public/application/components/empty_tree_placeholder/empty_tree_placeholder.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { EmptyTreePlaceHolder } from '.'; describe('EmptyTreePlaceholder', () => { diff --git a/x-pack/plugins/searchprofiler/public/application/components/highlight_details_flyout/highlight_details_flyout.test.tsx b/x-pack/plugins/searchprofiler/public/application/components/highlight_details_flyout/highlight_details_flyout.test.tsx index ef93896e7fe3e..ac8df87086e57 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/highlight_details_flyout/highlight_details_flyout.test.tsx +++ b/x-pack/plugins/searchprofiler/public/application/components/highlight_details_flyout/highlight_details_flyout.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { HighlightDetailsFlyout, Props } from '.'; describe('Highlight Details Flyout', () => { diff --git a/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.test.ts b/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.test.ts index 27109c0527032..a4a1f8864e883 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.test.ts +++ b/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { LicenseWarningNotice } from './license_warning_notice'; diff --git a/x-pack/plugins/searchprofiler/public/application/components/profile_loading_placeholder/profile_loading_placeholder.test.tsx b/x-pack/plugins/searchprofiler/public/application/components/profile_loading_placeholder/profile_loading_placeholder.test.tsx index caa858c41d702..d6c7a0afbf38d 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/profile_loading_placeholder/profile_loading_placeholder.test.tsx +++ b/x-pack/plugins/searchprofiler/public/application/components/profile_loading_placeholder/profile_loading_placeholder.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { ProfileLoadingPlaceholder } from '.'; describe('Profile Loading Placeholder', () => { diff --git a/x-pack/plugins/searchprofiler/public/application/components/profile_query_editor/editor/editor.test.tsx b/x-pack/plugins/searchprofiler/public/application/components/profile_query_editor/editor/editor.test.tsx index 8e495e7d2c49e..f92e2b2a5167c 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/profile_query_editor/editor/editor.test.tsx +++ b/x-pack/plugins/searchprofiler/public/application/components/profile_query_editor/editor/editor.test.tsx @@ -8,7 +8,7 @@ import 'brace'; import 'brace/mode/json'; -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { Editor, Props } from './editor'; describe('Editor Component', () => { diff --git a/x-pack/plugins/searchprofiler/public/application/components/profile_tree/__jest__/profile_tree.test.tsx b/x-pack/plugins/searchprofiler/public/application/components/profile_tree/__jest__/profile_tree.test.tsx index fef3c2e46958f..64cd05f3fa0a5 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/profile_tree/__jest__/profile_tree.test.tsx +++ b/x-pack/plugins/searchprofiler/public/application/components/profile_tree/__jest__/profile_tree.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { searchResponse } from './fixtures/search_response'; import { ProfileTree, Props } from '../profile_tree'; diff --git a/x-pack/plugins/searchprofiler/public/application/components/searchprofiler_tabs/searchprofiler_tabs.test.ts b/x-pack/plugins/searchprofiler/public/application/components/searchprofiler_tabs/searchprofiler_tabs.test.ts index 4cc7b0e5db966..daba54949efe8 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/searchprofiler_tabs/searchprofiler_tabs.test.ts +++ b/x-pack/plugins/searchprofiler/public/application/components/searchprofiler_tabs/searchprofiler_tabs.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed } from '@kbn/test/jest'; +import { registerTestBed } from '@kbn/test-jest-helpers'; import { SearchProfilerTabs, Props } from './searchprofiler_tabs'; diff --git a/x-pack/plugins/security/public/account_management/account_management_page.test.tsx b/x-pack/plugins/security/public/account_management/account_management_page.test.tsx index 4e9f1a6692eb9..fb73322655399 100644 --- a/x-pack/plugins/security/public/account_management/account_management_page.test.tsx +++ b/x-pack/plugins/security/public/account_management/account_management_page.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { AuthenticatedUser } from '../../common/model'; diff --git a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.test.tsx b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.test.tsx index f6fcf36a12ee6..a7a43077fbc46 100644 --- a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.test.tsx +++ b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.test.tsx @@ -10,7 +10,7 @@ import { act } from '@testing-library/react'; import React from 'react'; import ReactMarkdown from 'react-markdown'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { AccessAgreementPage } from './access_agreement_page'; diff --git a/x-pack/plugins/security/public/authentication/components/authentication_state_page/authentication_state_page.test.tsx b/x-pack/plugins/security/public/authentication/components/authentication_state_page/authentication_state_page.test.tsx index eba918e072110..f775d158a3ec0 100644 --- a/x-pack/plugins/security/public/authentication/components/authentication_state_page/authentication_state_page.test.tsx +++ b/x-pack/plugins/security/public/authentication/components/authentication_state_page/authentication_state_page.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { AuthenticationStatePage } from './authentication_state_page'; diff --git a/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.test.tsx b/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.test.tsx index 8647edd2ba06a..d21cf1bb5677c 100644 --- a/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.test.tsx +++ b/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.test.tsx @@ -8,7 +8,7 @@ import { EuiButton } from '@elastic/eui'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { LoggedOutPage } from './logged_out_page'; diff --git a/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.test.tsx b/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.test.tsx index a9bbcaab74ab0..9de62907261c1 100644 --- a/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.test.tsx +++ b/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.test.tsx @@ -11,7 +11,7 @@ import type { ReactWrapper } from 'enzyme'; import React from 'react'; import ReactMarkdown from 'react-markdown'; -import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { LoginForm, MessageType, PageMode } from './login_form'; diff --git a/x-pack/plugins/security/public/authentication/login/login_page.test.tsx b/x-pack/plugins/security/public/authentication/login/login_page.test.tsx index c01777a106490..6507355221259 100644 --- a/x-pack/plugins/security/public/authentication/login/login_page.test.tsx +++ b/x-pack/plugins/security/public/authentication/login/login_page.test.tsx @@ -10,7 +10,7 @@ import { act } from '@testing-library/react'; import { shallow } from 'enzyme'; import React from 'react'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { AUTH_PROVIDER_HINT_QUERY_STRING_PARAMETER } from '../../../common/constants'; diff --git a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.test.tsx b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.test.tsx index 42915e841b3a7..66b2408338391 100644 --- a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.test.tsx +++ b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.test.tsx @@ -9,7 +9,7 @@ import { EuiButton } from '@elastic/eui'; import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { mockAuthenticatedUser } from '../../../common/model/authenticated_user.mock'; diff --git a/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.test.tsx b/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.test.tsx index 3abcc07042e82..bde0980613b22 100644 --- a/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.test.tsx +++ b/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { RoleComboBox } from './role_combo_box'; diff --git a/x-pack/plugins/security/public/management/role_mappings/components/delete_provider/delete_provider.test.tsx b/x-pack/plugins/security/public/management/role_mappings/components/delete_provider/delete_provider.test.tsx index 17a6fb0bb84b3..55b6cbee4783a 100644 --- a/x-pack/plugins/security/public/management/role_mappings/components/delete_provider/delete_provider.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/components/delete_provider/delete_provider.test.tsx @@ -9,7 +9,7 @@ import { EuiConfirmModal } from '@elastic/eui'; import { act } from '@testing-library/react'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { RoleMapping } from '../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.test.tsx b/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.test.tsx index e3e5929428164..92ce48cda0cd2 100644 --- a/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { SectionLoading } from './section_loading'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.test.tsx index af7a2fb8d5240..083b742a21fe7 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.test.tsx @@ -8,11 +8,11 @@ // brace/ace uses the Worker class, which is not currently provided by JSDOM. // This is not required for the tests to pass, but it rather suppresses lengthy // warnings in the console which adds unnecessary noise to the test output. -import '@kbn/test/target_node/jest/utils/stub_web_worker'; +import '@kbn/test-jest-helpers/target_node/stub_web_worker'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { coreMock, scopedHistoryMock } from 'src/core/public/mocks'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.test.tsx index 3e18437a52ece..dd3bd25a745ca 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.test.tsx index a82b089f6630e..14cc6db062987 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { AddRoleTemplateButton } from './add_role_template_button'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.test.tsx index 367fdaadca96e..6d34dbffded8b 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.test.tsx @@ -8,7 +8,7 @@ import { EuiComboBox } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { Role, RoleMapping } from '../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.test.tsx index 844d7b48321c5..c8df67e4f7b98 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { RoleTemplateEditor } from './role_template_editor'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.test.tsx index 399d2fc2d2c91..2ada7e9730cb0 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { AllRule, FieldRule } from '../../model'; import { AddRuleButton } from './add_rule_button'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.test.tsx index c81f3cc9da595..e2e41e90be824 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.test.tsx @@ -8,7 +8,7 @@ import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { FieldRule } from '../../model'; import { FieldRuleEditor } from './field_rule_editor'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx index 5a1122a88ac80..06437675a8270 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.test.tsx @@ -10,13 +10,13 @@ import 'brace/mode/json'; // brace/ace uses the Worker class, which is not currently provided by JSDOM. // This is not required for the tests to pass, but it rather suppresses lengthy // warnings in the console which adds unnecessary noise to the test output. -import '@kbn/test/target_node/jest/utils/stub_web_worker'; +import '@kbn/test-jest-helpers/target_node//stub_web_worker'; import React from 'react'; import { act } from 'react-dom/test-utils'; import type { monaco } from '@kbn/monaco'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { CodeEditorField } from 'src/plugins/kibana_react/public'; import { AllRule, AnyRule, ExceptAllRule, ExceptAnyRule, FieldRule } from '../../model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.test.tsx index c0da0ae42a726..36b1390072408 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.test.tsx @@ -8,12 +8,12 @@ // brace/ace uses the Worker class, which is not currently provided by JSDOM. // This is not required for the tests to pass, but it rather suppresses lengthy // warnings in the console which adds unnecessary noise to the test output. -import '@kbn/test/target_node/jest/utils/stub_web_worker'; +import '@kbn/test-jest-helpers/target_node/stub_web_worker'; import { EuiErrorBoundary } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.test.tsx index 8915bef293bc2..07a458b6a48b9 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.test.tsx @@ -8,7 +8,7 @@ import { EuiContextMenuItem } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import { AllRule, AnyRule, ExceptAnyRule, FieldRule } from '../../model'; import { AddRuleButton } from './add_rule_button'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.test.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.test.tsx index fc48e2e1c8c9e..9428e860acc09 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { AllRule, AnyRule, ExceptAllRule, ExceptAnyRule, FieldRule } from '../../model'; import { FieldRuleEditor } from './field_rule_editor'; diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.test.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.test.tsx index d9009d49b592b..3ac54cb7863fd 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.test.tsx @@ -9,7 +9,7 @@ import { EuiLink } from '@elastic/eui'; import { act } from '@testing-library/react'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import type { CoreStart } from 'src/core/public'; import { coreMock, scopedHistoryMock } from 'src/core/public/mocks'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.test.tsx index e37b440d2c021..65c30d0a723ea 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.test.tsx @@ -8,7 +8,7 @@ import { EuiLink } from '@elastic/eui'; import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { CollapsiblePanel } from './collapsible_panel'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.test.tsx index 1faf514e71925..32d1e4fa6bafb 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.test.tsx @@ -8,7 +8,7 @@ import { EuiButtonEmpty, EuiConfirmModal } from '@elastic/eui'; import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { DeleteRoleButton } from './delete_role_button'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx index a99e08fd5a8a6..e7c3490d2ce13 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx @@ -9,7 +9,7 @@ import { act } from '@testing-library/react'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import type { Capabilities } from 'src/core/public'; import { coreMock, scopedHistoryMock } from 'src/core/public/mocks'; import { dataPluginMock } from 'src/plugins/data/public/mocks'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx index baeba5829562e..816e3f43c9ddc 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/cluster_privileges.test.tsx @@ -8,7 +8,7 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { Role } from '../../../../../../common/model'; import { ClusterPrivileges } from './cluster_privileges'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx index 0ed9362956960..9585db6efda25 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { licenseMock } from '../../../../../../common/licensing/index.mock'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx index af701df39d8b1..d61fd1e17e33b 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.test.tsx @@ -8,7 +8,7 @@ import { EuiButtonIcon, EuiComboBox, EuiTextArea } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx index 03c949d90e30a..440d5132baa33 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privileges.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { KibanaContextProvider } from '../../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/__fixtures__/index.ts b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/__fixtures__/index.ts index 3fab9d86e4dd3..c236bf15e3bb7 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/__fixtures__/index.ts +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/__fixtures__/index.ts @@ -9,7 +9,7 @@ import type { EuiButtonGroupProps, EuiCheckboxProps } from '@elastic/eui'; import { EuiAccordion, EuiButtonGroup, EuiCheckbox } from '@elastic/eui'; import type { ReactWrapper } from 'enzyme'; -import { findTestSubject } from '@kbn/test/jest'; +import { findTestSubject } from '@kbn/test-jest-helpers'; import { SubFeatureForm } from '../sub_feature_form'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx index 0cc4c4281b38f..4014a2a265abd 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.test.tsx @@ -8,7 +8,7 @@ import { EuiAccordion } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import type { KibanaFeature, SubFeatureConfig } from '../../../../../../../../features/public'; import type { Role } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx index cd1db2f9ce486..0503ec1bf75f9 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import type { Role } from '../../../../../../../common/model'; import { kibanaFeatures } from '../../../../__fixtures__/kibana_features'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx index d39d7acc6c3a1..c73dbb2616d2d 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.test.tsx @@ -9,7 +9,7 @@ import { EuiButtonGroup, EuiCheckbox } from '@elastic/eui'; import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { KibanaFeature } from '../../../../../../../../features/public'; import type { Role } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx index dcd2170325006..7052f724cd1cc 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table_cell/feature_table_cell.test.tsx @@ -8,7 +8,7 @@ import { EuiIconTip } from '@elastic/eui'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { createFeature } from '../../../../__fixtures__/kibana_features'; import { SecuredFeature } from '../../../../model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/__fixtures__/index.ts b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/__fixtures__/index.ts index 6f5c729784bb1..3a70ff5713bd9 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/__fixtures__/index.ts +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/__fixtures__/index.ts @@ -8,7 +8,7 @@ import { EuiTableRow } from '@elastic/eui'; import type { ReactWrapper } from 'enzyme'; -import { findTestSubject } from '@kbn/test/jest'; +import { findTestSubject } from '@kbn/test-jest-helpers'; import type { Role, RoleKibanaPrivilege } from '../../../../../../../../common/model'; import { FeatureTableCell } from '../../feature_table_cell'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.test.tsx index b23566019b31a..928a9f5d28fea 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { spacesManagerMock } from '../../../../../../../../spaces/public/spaces_manager/mocks'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx index 93ed2d000bb0e..0a3620aaa4114 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { spacesManagerMock } from '../../../../../../../../spaces/public/spaces_manager/mocks'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.test.tsx index 77c8cdd69ec44..e3746e7fb1051 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { SpaceAvatarInternal } from '../../../../../../../../spaces/public/space_avatar/space_avatar_internal'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_display.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_display.test.tsx index 8aa2b77f8fc12..c4400abba2da2 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_display.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_display.test.tsx @@ -8,7 +8,7 @@ import { EuiText } from '@elastic/eui'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { PrivilegeDisplay } from './privilege_display'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx index 7976d76ff8d86..8eaae663e7e80 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.test.tsx @@ -8,7 +8,7 @@ import { EuiButtonGroup } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import type { Space } from '../../../../../../../../spaces/public'; import type { Role } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.test.tsx index 6f00df3a4ee7b..9b86ad54c4d35 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.test.tsx @@ -9,7 +9,7 @@ import { EuiBadge, EuiInMemoryTable } from '@elastic/eui'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { KibanaFeature } from '../../../../../../../../features/public'; import type { Role, RoleKibanaPrivilege } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx index ebc82f28f5426..beaaf783f2f4d 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { kibanaFeatures } from '../../../../__fixtures__/kibana_features'; import { createKibanaPrivileges } from '../../../../__fixtures__/kibana_privileges'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.test.tsx index 031df26eb38f7..572822db3ca2a 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.test.tsx @@ -15,7 +15,7 @@ import { import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { Space } from '../../../../../../spaces/public'; diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx index aa507cf823eff..7041a61a850d0 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.test.tsx @@ -9,7 +9,7 @@ import { EuiBasicTable, EuiIcon } from '@elastic/eui'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { coreMock, scopedHistoryMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.test.tsx b/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.test.tsx index 3d8c95d52f505..cf1959f8a389f 100644 --- a/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.test.tsx +++ b/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.test.tsx @@ -9,7 +9,7 @@ import { EuiFieldPassword } from '@elastic/eui'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { User } from '../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.test.tsx b/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.test.tsx index 5ce22b42e624f..2668050645f33 100644 --- a/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.test.tsx +++ b/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { userAPIClientMock } from '../../index.mock'; diff --git a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.test.tsx b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.test.tsx index b340a915bc054..898fec5709c56 100644 --- a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.test.tsx +++ b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.test.tsx @@ -10,7 +10,7 @@ import type { ReactWrapper } from 'enzyme'; import type { LocationDescriptorObject } from 'history'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import type { CoreStart, ScopedHistory } from 'src/core/public'; import { coreMock, scopedHistoryMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx b/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx index adaca23be5dae..be74cca3d2671 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx +++ b/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx @@ -9,7 +9,7 @@ import { EuiContextMenuItem, EuiHeaderSectionItemButton, EuiPopover } from '@ela import React from 'react'; import { BehaviorSubject } from 'rxjs'; -import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import type { AuthenticatedUser } from '../../common/model'; import { mockAuthenticatedUser } from '../../common/model/authenticated_user.mock'; diff --git a/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts b/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts index f19b88dd91c34..21352f16d2354 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts +++ b/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts @@ -7,7 +7,7 @@ import { BehaviorSubject } from 'rxjs'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { ILicense } from '../../../licensing/public'; diff --git a/x-pack/plugins/security/public/security_checkup/security_checkup_service.test.ts b/x-pack/plugins/security/public/security_checkup/security_checkup_service.test.ts index 1c4a15a8cfb93..b71d42fb08adc 100644 --- a/x-pack/plugins/security/public/security_checkup/security_checkup_service.test.ts +++ b/x-pack/plugins/security/public/security_checkup/security_checkup_service.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import type { DocLinksStart } from 'src/core/public'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/security/server/authorization/authorization_service.test.ts b/x-pack/plugins/security/server/authorization/authorization_service.test.ts index ff6f510f64b28..61ca8423fc626 100644 --- a/x-pack/plugins/security/server/authorization/authorization_service.test.ts +++ b/x-pack/plugins/security/server/authorization/authorization_service.test.ts @@ -7,7 +7,7 @@ import { Subject } from 'rxjs'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { coreMock, elasticsearchServiceMock, loggingSystemMock } from 'src/core/server/mocks'; // Note: this import must be before other relative imports for the mocks to work as intended. diff --git a/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts b/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts index 65fe1de0c962c..0cbf04aac4f58 100644 --- a/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts +++ b/x-pack/plugins/security/server/elasticsearch/elasticsearch_service.test.ts @@ -7,7 +7,7 @@ import { BehaviorSubject } from 'rxjs'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import type { CoreStatus } from 'src/core/server'; import { ServiceStatusLevels } from 'src/core/server'; import { coreMock, loggingSystemMock } from 'src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/session_management/session_management_service.test.ts b/x-pack/plugins/security/server/session_management/session_management_service.test.ts index 100d0b30082c6..6570dca0801da 100644 --- a/x-pack/plugins/security/server/session_management/session_management_service.test.ts +++ b/x-pack/plugins/security/server/session_management/session_management_service.test.ts @@ -7,7 +7,7 @@ import { Subject } from 'rxjs'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { coreMock, elasticsearchServiceMock, loggingSystemMock } from 'src/core/server/mocks'; import type { diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx b/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx index 8bf2bba491051..c455ed1953c28 100644 --- a/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { defaultToEmptyTag, diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.test.tsx index 531ad1318e0e1..6c3dba5f2e22b 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/error_callout.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { getListMock } from '../../../../common/detection_engine/schemas/types/lists.mock'; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx index 9bbd490f1ed16..562c6a7250a5d 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ExceptionsViewerUtility } from './exceptions_utility'; import { getMockTheme } from '../../../lib/kibana/kibana_react.mock'; diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx index 0c077aaea81a8..97f93b9732c02 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow, ReactWrapper, ShallowWrapper } from 'enzyme'; import React from 'react'; import { removeExternalLinkText } from '@kbn/securitysolution-io-ts-utils'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { encodeIpv6 } from '../../lib/helpers'; import { useUiSetting$ } from '../../lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx index a3d6cb50bef57..ebd1c0c4df109 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { MlPopover } from './ml_popover'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx index c130ea4c96814..1e6a4b15bf124 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { useParams } from 'react-router-dom'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx index 54b405feeb176..6a9d4a6bbdbe8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { useParams } from 'react-router-dom'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx index 607bccdbc039d..e00a23261e747 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx @@ -7,7 +7,7 @@ import { cloneDeep } from 'lodash/fp'; import moment from 'moment'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import '../../../../common/mock/formatted_relative'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx index a215f02863123..24683cfdab548 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx @@ -6,7 +6,7 @@ */ import { cloneDeep } from 'lodash/fp'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; import { waitFor } from '@testing-library/react'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx index 794cd275528e4..e2184aaaec773 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx @@ -6,7 +6,7 @@ */ import { cloneDeep } from 'lodash/fp'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx index 1c650b0ae0a11..55d230d118e25 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx @@ -6,7 +6,7 @@ */ import { EuiFilterButtonProps } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx index 2a77f872117f6..925ea396b7fa0 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx @@ -7,7 +7,7 @@ import { EuiButtonIconProps } from '@elastic/eui'; import { cloneDeep, omit } from 'lodash/fp'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx index bdb55aaf20969..5b17994a64530 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx @@ -9,7 +9,7 @@ import { EuiButtonIconProps } from '@elastic/eui'; import { cloneDeep, omit } from 'lodash/fp'; import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import '../../../../common/mock/match_media'; import '../../../../common/mock/formatted_relative'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx index e8960d2e0ad93..89331ca8e33bf 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx @@ -6,7 +6,7 @@ */ import { cloneDeep, omit } from 'lodash/fp'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx index a92d3a4eac4b0..01e9c588f0ef5 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx @@ -6,7 +6,7 @@ */ import { cloneDeep, omit } from 'lodash/fp'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx index c1aecd4a33825..55de25ff283e3 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx @@ -6,7 +6,7 @@ */ import { cloneDeep } from 'lodash/fp'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx index a94777d0e573b..d46cad3c43a98 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/title_row/index.test.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonProps } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts index 1e16fa2a40129..45b31a19693b7 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts @@ -13,7 +13,7 @@ import { TestBed, AsyncTestBedConfig, delay, -} from '@kbn/test/jest'; +} from '@kbn/test-jest-helpers'; import { SnapshotRestoreHome } from '../../../public/application/sections/home/home'; import { BASE_PATH } from '../../../public/application/constants'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/index.ts index fdf8ea8d83868..51c41bc49bc3d 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/index.ts @@ -14,8 +14,8 @@ import { setup as policyEditSetup } from './policy_edit.helpers'; import { setup as restoreSnapshotSetup } from './restore_snapshot.helpers'; import { setup as snapshotListSetup } from './snapshot_list.helpers'; -export type { TestBed } from '@kbn/test/jest'; -export { nextTick, getRandomString, findTestSubject, delay } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { nextTick, getRandomString, findTestSubject, delay } from '@kbn/test-jest-helpers'; export { setupEnvironment } from './setup_environment'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts index a6e7c4a4c1056..d921b96781d0c 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { PolicyAdd } from '../../../public/application/sections/policy_add'; import { formSetup, PolicyFormTestSubjects } from './policy_form.helpers'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts index 2014d22ffbfbc..461351e744125 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { PolicyEdit } from '../../../public/application/sections/policy_edit'; import { WithAppDependencies } from './setup_environment'; import { POLICY_NAME } from './constant'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_form.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_form.helpers.ts index f097f6185fc7c..c776a22ef9868 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_form.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_form.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { TestBed, SetupFunc } from '@kbn/test/jest'; +import { TestBed, SetupFunc } from '@kbn/test-jest-helpers'; export interface PolicyFormTestBed extends TestBed { actions: { diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts index b369b20c122eb..c6460078482bf 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed } from '@kbn/test/jest'; +import { registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { RepositoryType } from '../../../common/types'; import { RepositoryAdd } from '../../../public/application/sections/repository_add'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts index f0563f2831a98..275c216d70664 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { RepositoryEdit } from '../../../public/application/sections/repository_edit'; import { WithAppDependencies } from './setup_environment'; import { REPOSITORY_NAME } from './constant'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts index 123ae0cbb1c2e..86c93a6811bd4 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { RestoreSnapshot } from '../../../public/application/sections/restore_snapshot'; import { WithAppDependencies } from './setup_environment'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/snapshot_list.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/snapshot_list.helpers.ts index 176e5714f1308..261976623144b 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/snapshot_list.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/snapshot_list.helpers.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { TestBedConfig, registerTestBed, TestBed } from '@kbn/test/jest'; +import { TestBedConfig, registerTestBed, TestBed } from '@kbn/test-jest-helpers'; import { BASE_PATH } from '../../../public/application/constants'; import { SnapshotList } from '../../../public/application/sections/home/snapshot_list'; diff --git a/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts b/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts index 873d36fcc656e..66d5b9557fae2 100644 --- a/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts +++ b/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString, getRandomNumber } from '@kbn/test/jest'; +import { getRandomString, getRandomNumber } from '@kbn/test-jest-helpers'; import { SlmPolicy } from '../../common/types'; import { DEFAULT_POLICY_SCHEDULE } from '../../public/application/constants'; diff --git a/x-pack/plugins/snapshot_restore/test/fixtures/repository.ts b/x-pack/plugins/snapshot_restore/test/fixtures/repository.ts index b906a657f1ad7..16f2bea61bc28 100644 --- a/x-pack/plugins/snapshot_restore/test/fixtures/repository.ts +++ b/x-pack/plugins/snapshot_restore/test/fixtures/repository.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; import { RepositoryType } from '../../common/types'; const defaultSettings: any = { chunkSize: '10mb', location: '/tmp/es-backups' }; diff --git a/x-pack/plugins/snapshot_restore/test/fixtures/snapshot.ts b/x-pack/plugins/snapshot_restore/test/fixtures/snapshot.ts index 8b385b5e83006..e7fad7f4a291f 100644 --- a/x-pack/plugins/snapshot_restore/test/fixtures/snapshot.ts +++ b/x-pack/plugins/snapshot_restore/test/fixtures/snapshot.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString, getRandomNumber } from '@kbn/test/jest'; +import { getRandomString, getRandomNumber } from '@kbn/test-jest-helpers'; export const getSnapshot = ({ repository = 'my-repo', diff --git a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.test.tsx b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.test.tsx index 6e215b20e4f2a..7352e769f7e55 100644 --- a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.test.tsx +++ b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.test.tsx @@ -9,7 +9,7 @@ import { EuiCallOut } from '@elastic/eui'; import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { AdvancedSettingsSubtitle } from './advanced_settings_subtitle'; diff --git a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.test.tsx b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.test.tsx index 95dd62a6680a6..e8b6766411d0c 100644 --- a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.test.tsx +++ b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { SpaceAvatarInternal } from '../../../space_avatar/space_avatar_internal'; import { AdvancedSettingsTitle } from './advanced_settings_title'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.test.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.test.tsx index 9c69b172751cf..a9da59c37739d 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.test.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.test.tsx @@ -8,7 +8,7 @@ import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { CopyModeControlProps } from './copy_mode_control'; import { CopyModeControl } from './copy_mode_control'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.test.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.test.tsx index a9768bea9d1ed..858fddaf4698b 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.test.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.test.tsx @@ -10,7 +10,7 @@ import Boom from '@hapi/boom'; import { act } from '@testing-library/react'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { Space } from '../../../common'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.test.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.test.tsx index 96fe78e237a80..ad183196039c6 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.test.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.test.tsx @@ -9,7 +9,7 @@ import { act } from '@testing-library/react'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import type { SummarizedCopyToSpaceResult } from '../lib'; import type { ImportRetry } from '../types'; diff --git a/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.test.tsx b/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.test.tsx index b999ae961d0f1..5f4f1f845717a 100644 --- a/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.test.tsx +++ b/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.test.tsx @@ -10,7 +10,7 @@ import { act } from '@testing-library/react'; import React from 'react'; import { BehaviorSubject } from 'rxjs'; -import { findTestSubject, mountWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { LegacyUrlConflictInternal } from './legacy_url_conflict_internal'; diff --git a/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.test.tsx b/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.test.tsx index 59c7dde71aedb..4b1ad8a6fe01f 100644 --- a/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.test.tsx +++ b/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { spacesManagerMock } from '../../../spaces_manager/mocks'; import { ConfirmDeleteModal } from './confirm_delete_modal'; diff --git a/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.test.tsx b/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.test.tsx index 0f26c69cac2be..6a491e5303149 100644 --- a/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.test.tsx +++ b/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { UnauthorizedPrompt } from './unauthorized_prompt'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.test.tsx index f4ba960b2f3a4..5c9ed1b6a3283 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ConfirmAlterActiveSpaceModal } from './confirm_alter_active_space_modal'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.test.tsx index 42195317e6731..cea22e31a8289 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { SpaceValidator } from '../../lib'; import { CustomizeSpace } from './customize_space'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space_avatar.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space_avatar.test.tsx index 578da9b96611c..ddc767163f0b5 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space_avatar.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space_avatar.test.tsx @@ -8,7 +8,7 @@ import { EuiColorPicker, EuiFieldText, EuiLink } from '@elastic/eui'; import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { SpaceValidator } from '../../lib'; import { CustomizeSpaceAvatar } from './customize_space_avatar'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.test.tsx index 900c032c8fbfa..d3f95cadc051f 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { notificationServiceMock } from 'src/core/public/mocks'; import type { SpacesManager } from '../../spaces_manager'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.test.tsx index af6c546fcf56a..5283cfe8ad1a3 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.test.tsx @@ -8,7 +8,7 @@ import type { EuiCheckboxProps } from '@elastic/eui'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick, shallowWithIntl } from '@kbn/test-jest-helpers'; import { DEFAULT_APP_CATEGORIES } from 'src/core/public'; import type { KibanaFeatureConfig } from '../../../../../features/public'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx index 465cb76c9e5bd..55672e9896ea3 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx @@ -11,7 +11,7 @@ import { waitFor } from '@testing-library/react'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DEFAULT_APP_CATEGORIES } from 'src/core/public'; import { notificationServiceMock, scopedHistoryMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.test.tsx index d8fb026058dd0..de3977ac792d0 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.test.tsx @@ -8,7 +8,7 @@ import { EuiBadge } from '@elastic/eui'; import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ReservedSpaceBadge } from './reserved_space_badge'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/section_panel/section_panel.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/section_panel/section_panel.test.tsx index 733044e638f5f..125697c6f4e19 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/section_panel/section_panel.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/section_panel/section_panel.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { SectionPanel } from './section_panel'; diff --git a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx index bb1ea2914fc43..8cff17b4dfe57 100644 --- a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.test.tsx @@ -8,7 +8,7 @@ import { act } from '@testing-library/react'; import React from 'react'; -import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { httpServiceMock, notificationServiceMock, scopedHistoryMock } from 'src/core/public/mocks'; import { KibanaFeature } from '../../../../features/public'; diff --git a/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.test.tsx b/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.test.tsx index 3e1d77d0a45f1..563b3693bcd7b 100644 --- a/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.test.tsx +++ b/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ManageSpacesButton } from './manage_spaces_button'; diff --git a/x-pack/plugins/spaces/public/nav_control/nav_control_popover.test.tsx b/x-pack/plugins/spaces/public/nav_control/nav_control_popover.test.tsx index d1282331027c2..8e5aa0c6769fe 100644 --- a/x-pack/plugins/spaces/public/nav_control/nav_control_popover.test.tsx +++ b/x-pack/plugins/spaces/public/nav_control/nav_control_popover.test.tsx @@ -11,7 +11,7 @@ import { shallow } from 'enzyme'; import React from 'react'; import * as Rx from 'rxjs'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { SpaceAvatarInternal } from '../space_avatar/space_avatar_internal'; import type { SpacesManager } from '../spaces_manager'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.test.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.test.tsx index 6daea2413599a..3c84b5da2796b 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.test.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.test.tsx @@ -11,7 +11,7 @@ import { act } from '@testing-library/react'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test/jest'; +import { findTestSubject, mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import type { SavedObjectReferenceWithContext } from 'src/core/public'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/spaces/public/space_list/space_list_internal.test.tsx b/x-pack/plugins/spaces/public/space_list/space_list_internal.test.tsx index 39ae339fb7e18..cc365e943a510 100644 --- a/x-pack/plugins/spaces/public/space_list/space_list_internal.test.tsx +++ b/x-pack/plugins/spaces/public/space_list/space_list_internal.test.tsx @@ -9,7 +9,7 @@ import { act } from '@testing-library/react'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import type { Space } from '../../common'; diff --git a/x-pack/plugins/spaces/public/space_selector/space_selector.test.tsx b/x-pack/plugins/spaces/public/space_selector/space_selector.test.tsx index e17c3e0078d42..7764bcc2c3b9c 100644 --- a/x-pack/plugins/spaces/public/space_selector/space_selector.test.tsx +++ b/x-pack/plugins/spaces/public/space_selector/space_selector.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import type { Space } from '../../common'; import { spacesManagerMock } from '../spaces_manager/mocks'; diff --git a/x-pack/plugins/spaces/public/spaces_manager/spaces_manager.test.ts b/x-pack/plugins/spaces/public/spaces_manager/spaces_manager.test.ts index d09177a915d99..f1e4b767b934c 100644 --- a/x-pack/plugins/spaces/public/spaces_manager/spaces_manager.test.ts +++ b/x-pack/plugins/spaces/public/spaces_manager/spaces_manager.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { coreMock } from 'src/core/public/mocks'; import { SpacesManager } from './spaces_manager'; diff --git a/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts b/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts index c082a75cc894b..d8a1689ae3bd6 100644 --- a/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts +++ b/x-pack/plugins/spaces/server/default_space/default_space_service.test.ts @@ -8,7 +8,7 @@ import * as Rx from 'rxjs'; import { first } from 'rxjs/operators'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import type { Writable } from '@kbn/utility-types'; import type { CoreStatus, SavedObjectsRepository, ServiceStatusLevel } from 'src/core/server'; import { SavedObjectsErrorHelpers, ServiceStatusLevels } from 'src/core/server'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.test.tsx index 3b7baac9b80e6..e5c8343fddf6d 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.test.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { IndexSelectPopover } from './index_select_popover'; import { EuiComboBox } from '@elastic/eui'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.test.tsx index 994eeadd50d3b..7ecdcd6dbce38 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import 'brace'; import { of } from 'rxjs'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import EsQueryAlertTypeExpression from './expression'; import { dataPluginMock } from 'src/plugins/data/public/mocks'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx index bf46df5eabfa7..d0aaa9b8fda52 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import IndexThresholdAlertTypeExpression, { DEFAULT_VALUES } from './expression'; import { dataPluginMock } from 'src/plugins/data/public/mocks'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx index a27646c1643fa..ed667b4940f29 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { ThresholdVisualization } from './visualization'; import { DataPublicPluginStart } from 'src/plugins/data/public/types'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; diff --git a/x-pack/plugins/timelines/public/components/empty_value/empty_value.test.tsx b/x-pack/plugins/timelines/public/components/empty_value/empty_value.test.tsx index be9a086d8dc5b..0e5ee638d29e8 100644 --- a/x-pack/plugins/timelines/public/components/empty_value/empty_value.test.tsx +++ b/x-pack/plugins/timelines/public/components/empty_value/empty_value.test.tsx @@ -8,7 +8,7 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { defaultToEmptyTag, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/add_message_variables.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/add_message_variables.test.tsx index 4e03a2a09bed4..1c21170005265 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/add_message_variables.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/add_message_variables.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { AddMessageVariables } from './add_message_variables'; describe('AddMessageVariables', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.test.tsx index a96e1fc3dcb5d..742e8981a1a1a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EmailActionConnector } from '../types'; import EmailActionConnectorFields from './email_connector'; import * as hooks from './use_email_config'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.test.tsx index 6a173cfd80926..1762fc0b39f8e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import EmailParamsFields from './email_params'; describe('EmailParamsFields renders', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.test.tsx index 2a08c9b19e602..d87efe5134794 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EmailActionConnector } from '../types'; import ExchangeFormFields from './exchange_form'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.test.tsx index 9ef498334ad3d..6aa7fde6d23e1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { EsIndexActionConnector } from '../types'; import IndexActionConnectorFields from './es_index_connector'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.test.tsx index 75c4fe2d5a055..6125255b3a52a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; import ParamsFields from './es_index_params'; import { AlertHistoryEsIndexConnectorId } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_connectors.test.tsx index 4859c25adcc06..1c8c58c7c4a16 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import JiraConnectorFields from './jira_connectors'; import { JiraActionConnector } from './types'; jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.test.tsx index 8be15ddaa6bca..0d10223af66cf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { PagerDutyActionConnector } from '.././types'; import PagerDutyActionConnectorFields from './pagerduty_connectors'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_params.test.tsx index f67267a75ed33..6eb349b8f511c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EventActionOptions, SeverityActionOptions } from '.././types'; import PagerDutyParamsFields from './pagerduty_params'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_connectors.test.tsx index 35891f513be6b..13459888ac365 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import ResilientConnectorFields from './resilient_connectors'; import { ResilientActionConnector } from './types'; jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx index eba971dd66db4..baaffb6721fc4 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/server_log/server_log_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ServerLogLevelOptions } from '.././types'; import ServerLogParamsFields from './server_log_params'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx index 03acb673bf5a4..786c84942e08f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { act } from '@testing-library/react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { useKibana } from '../../../../common/lib/kibana'; import { ActionConnectorFieldsSetCallbacks } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx index bdb38d85a8923..a5804dc484cbb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; import { ActionConnector } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx index de331893ad0cf..5fa15de036844 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { act } from '@testing-library/react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ActionConnector } from '../../../../types'; import { useGetChoices } from './use_get_choices'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx index ecb90051e78c2..00cce14906e82 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { UpdateConnector, Props } from './update_connector'; import { ServiceNowActionConnector } from './types'; jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.test.tsx index 0a37165bd7f5f..c0f6a17cae4fe 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; import { SlackActionConnector } from '../types'; import SlackActionFields from './slack_connectors'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_params.test.tsx index 74ee201340cc0..6611b33e094b2 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import SlackParamsFields from './slack_params'; describe('SlackParamsFields renders', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_connectors.test.tsx index 4829156380e94..47e5c09c13864 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { SwimlaneActionConnector } from './types'; import SwimlaneActionConnectorFields from './swimlane_connectors'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx index f1d7efca39551..03f20546b1003 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import SwimlaneParamsFields from './swimlane_params'; import { SwimlaneConnectorType } from './types'; import { mappings } from './mocks'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.test.tsx index 5031b32281258..2d2b6d5052bb8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; import { TeamsActionConnector } from '../types'; import TeamsActionFields from './teams_connectors'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_params.test.tsx index 9d5e86d413d93..cf0bfe9db0e97 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import TeamsParamsFields from './teams_params'; jest.mock('../../../../common/lib/kibana'); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.test.tsx index ea40c1ddfb139..2579d8dd1a93b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { WebhookActionConnector } from '../types'; import WebhookActionConnectorFields from './webhook_connectors'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_params.test.tsx index 7c9ffaa23659b..064d21b50e463 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_params.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import WebhookParamsFields from './webhook_params'; import { MockCodeEditor } from '../../../code_editor.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/json_editor_with_message_variables.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/json_editor_with_message_variables.test.tsx index 6a705798a9b7f..068e4755be165 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/json_editor_with_message_variables.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/json_editor_with_message_variables.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { JsonEditorWithMessageVariables } from './json_editor_with_message_variables'; import { MockCodeEditor } from '../code_editor.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/text_area_with_message_variables.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/text_area_with_message_variables.test.tsx index 72ea099f87d26..0f3981391a49c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/text_area_with_message_variables.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/text_area_with_message_variables.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TextAreaWithMessageVariables } from './text_area_with_message_variables'; describe('TextAreaWithMessageVariables', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/text_field_with_message_variables.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/text_field_with_message_variables.test.tsx index e0d74c5568c70..43c7ac51591b5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/text_field_with_message_variables.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/text_field_with_message_variables.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { TextFieldWithMessageVariables } from './text_field_with_message_variables'; describe('TextFieldWithMessageVariables', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/home.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/home.test.tsx index 3594374a54f16..51f80438c55cc 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/home.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/home.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { RouteComponentProps, Router } from 'react-router-dom'; import { createMemoryHistory, createLocation } from 'history'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import TriggersActionsUIHome, { MatchParams } from './home'; import { useKibana } from '../common/lib/kibana'; jest.mock('../common/lib/kibana'); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.test.tsx index 5a4d682ff573b..4addfc3833aab 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { UserConfiguredActionConnector, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx index f7c15dade55e3..ace563aa96b9e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx @@ -6,7 +6,7 @@ */ import React, { lazy } from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { EuiAccordion } from '@elastic/eui'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { act } from 'react-dom/test-utils'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx index e8590595b9d61..e04b96b6839cf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { ActionTypeForm } from './action_type_form'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.test.tsx index e15916138af71..e8a0287d90026 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { ActionTypeMenu } from './action_type_menu'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.test.tsx index 8dbe5f105a0f7..9870786e5d3cc 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import ConnectorAddFlyout from './connector_add_flyout'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.test.tsx index 1502b4255767d..0666f8be394d8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import ConnectorAddModal from './connector_add_modal'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.test.tsx index e6d3c0bde8113..e2bc9d44b147c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { ConnectorValidationResult, GenericValidationResult } from '../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx index 6c383913a3c0f..1ecb651314ba9 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx @@ -7,7 +7,7 @@ import * as React from 'react'; import { render, screen } from '@testing-library/react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; import { ConnectorsSelection } from './connectors_selection'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx index 7a3edcf4cb948..cc928d5c30fd9 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx @@ -16,7 +16,7 @@ import { } from '../../../types'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { EuiFormRow, EuiFieldText, EuiText, EuiLink, EuiForm, EuiSelect } from '@elastic/eui'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; jest.mock('../../../common/lib/kibana'); const mockedActionParamsFields = lazy(async () => ({ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx index d477fcd0ddf74..1de8ad97af891 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; // eslint-disable-next-line @kbn/eslint/module_migration import { ThemeProvider } from 'styled-components'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import ActionsConnectorsList from './actions_connectors_list'; import { coreMock } from '../../../../../../../../src/core/public/mocks'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx index b92b4289ea905..e12322c3b84ad 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import uuid from 'uuid'; import { shallow } from 'enzyme'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; import { AlertDetails } from './alert_details'; import { Rule, ActionType, RuleTypeModel, RuleType } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx index 770b273b02c29..9bfb8f20744de 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import uuid from 'uuid'; import { shallow } from 'enzyme'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { createMemoryHistory, createLocation } from 'history'; import { ToastsApi } from 'kibana/public'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx index 075f6dedeb06a..909a562224ef7 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import uuid from 'uuid'; import { shallow } from 'enzyme'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { Alerts, AlertListItem, alertToListItem } from './alerts'; import { Rule, AlertSummary, AlertStatus, RuleType } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx index 3187021518c9c..7e45dd8ac636a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx @@ -7,7 +7,7 @@ import uuid from 'uuid'; import React, { FunctionComponent } from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormLabel } from '@elastic/eui'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx index f4ed8d0b05a85..07f7b1475b92f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { AlertConditions, ActionGroupWithCondition } from './alert_conditions'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.test.tsx index f730f73a417ba..49a2ec087a2b8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { AlertConditionsGroup } from './alert_conditions_group'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx index 226734ca46a67..ec33756cfec4a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx index 37741dcaab6e5..49803c0cc419d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx index 1534e0ed4f6b8..c15f249fd7688 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { Rule } from '../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx index ce94ef75ac156..2ca32ec04cd70 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { actionTypeRegistryMock } from '../../../action_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx index a54bc67244b35..a036feea0fbcb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { CollapsedItemActions } from './collapsed_item_actions'; import { act } from 'react-dom/test-utils'; import { ruleTypeRegistryMock } from '../../../rule_type_registry.mock'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx index da75faeda95e9..0773d6c9c5ed0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { RuleEnabledSwitch, ComponentOpts } from './rule_enabled_switch'; describe('RuleEnabledSwitch', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx index f524ff4426b6a..f98f82e412f86 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.test.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { ExecutionDurationChart, padOrTruncateDurations } from './execution_duration_chart'; diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/threshold.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/threshold.test.tsx index 653c0ebadcfae..bb94e1d38757a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/threshold.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/threshold.test.tsx @@ -7,7 +7,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ThresholdExpression } from './threshold'; describe('threshold expression', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/value.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/value.test.tsx index e9a3dce84e149..6ff6206db456a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/value.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/value.test.tsx @@ -9,7 +9,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { ValueExpression } from './value'; -import { mountWithIntl, nextTick } from '@kbn/test/jest'; +import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; describe('value expression', () => { it('renders description and value', () => { diff --git a/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts b/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts index 889b6377b16b5..663161f5ebd2d 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts @@ -19,7 +19,7 @@ import { HELLO_WORLD_EMBEDDABLE, } from '../../../../src/plugins/embeddable/public/tests/fixtures'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; import { ReactElement } from 'react'; const createOpenModalMock = () => { diff --git a/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_badge.test.ts b/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_badge.test.ts index b4134ddd17395..f31e2552fa717 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_badge.test.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/custom_time_range_badge.test.ts @@ -12,7 +12,7 @@ import { mount } from 'enzyme'; import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers'; import { CustomTimeRangeBadge } from './custom_time_range_badge'; import { ReactElement } from 'react'; -import { nextTick } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; test('Removing custom time range from badge resets embeddable back to container time', async () => { const container = new TimeRangeContainer( diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/app/app.helpers.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/app/app.helpers.tsx index 55c8c7f721a49..25e38b4111e50 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/app/app.helpers.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/app/app.helpers.tsx @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { App } from '../../../public/application/app'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.helpers.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.helpers.ts index 11784d0269505..31bbcd01a7320 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.helpers.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.helpers.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { EsDeprecationLogs } from '../../../public/application/components/es_deprecation_logs'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/es_deprecations.helpers.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/es_deprecations.helpers.ts index 28ec1983cbeda..08d53d1eaca7e 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/es_deprecations.helpers.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/es_deprecations.helpers.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { EsDeprecations } from '../../../public/application/components/es_deprecations'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/kibana_deprecations.helpers.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/kibana_deprecations.helpers.ts index 8d14a211786c4..9f98496ac2edf 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/kibana_deprecations.helpers.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/kibana_deprecations.helpers.ts @@ -5,7 +5,12 @@ * 2.0. */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig, findTestSubject } from '@kbn/test/jest'; +import { + registerTestBed, + TestBed, + AsyncTestBedConfig, + findTestSubject, +} from '@kbn/test-jest-helpers'; import { KibanaDeprecations } from '../../../public/application/components'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/overview.helpers.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/overview.helpers.ts index 34abaed727bd3..30a531091f166 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/overview.helpers.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/overview.helpers.ts @@ -6,7 +6,7 @@ */ import { act } from 'react-dom/test-utils'; -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { Overview } from '../../../public/application/components/overview'; import { WithAppDependencies } from '../helpers'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx index 9d8aa3d4d091f..1f185b964b668 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx @@ -6,7 +6,7 @@ */ import { ChartEmptyState } from './chart_empty_state'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/chart_wrapper.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/chart_wrapper.test.tsx index 25b316344b32a..37354104cf871 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/chart_wrapper.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/chart_wrapper.test.tsx @@ -8,8 +8,8 @@ import React from 'react'; import { EuiSpacer } from '@elastic/eui'; import { mount } from 'enzyme'; -import { nextTick } from '@kbn/test/jest'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { nextTick } from '@kbn/test-jest-helpers'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ChartWrapper } from './chart_wrapper'; import { SnapshotHeading } from '../../overview/snapshot/snapshot_heading'; import { DonutChart } from './donut_chart'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/donut_chart.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/donut_chart.test.tsx index ee01235a75fd7..ff83c51900cdf 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/donut_chart.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/donut_chart.test.tsx @@ -6,7 +6,7 @@ */ import { DonutChart } from './donut_chart'; -import { renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; describe('DonutChart component', () => { diff --git a/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend.test.tsx index f2f9757afce07..3e5a5c2539680 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl } from '@kbn/test/jest'; +import { renderWithIntl } from '@kbn/test-jest-helpers'; import { DonutChartLegend } from './donut_chart_legend'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend_row.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend_row.test.tsx index 1b73b80bacd57..cae142b2a4f79 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend_row.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/donut_chart_legend_row.test.tsx @@ -6,7 +6,7 @@ */ import { DonutChartLegendRow } from './donut_chart_legend_row'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; describe('DonutChartLegendRow', () => { diff --git a/x-pack/plugins/uptime/public/components/common/location_link.test.tsx b/x-pack/plugins/uptime/public/components/common/location_link.test.tsx index 177015b93d3f3..285ee6cb47725 100644 --- a/x-pack/plugins/uptime/public/components/common/location_link.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/location_link.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { LocationLink } from './location_link'; diff --git a/x-pack/plugins/uptime/public/components/common/monitor_page_link.test.tsx b/x-pack/plugins/uptime/public/components/common/monitor_page_link.test.tsx index 317af4c083ca2..9bd7db2de7f6b 100644 --- a/x-pack/plugins/uptime/public/components/common/monitor_page_link.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/monitor_page_link.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { MonitorPageLink } from './monitor_page_link'; describe('MonitorPageLink component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.test.tsx index c88349282b7b4..5f46169901e57 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ConfirmJobDeletion } from './confirm_delete'; describe('ML Confirm Job Delete', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.test.tsx index dd42a14890793..f87501a79e964 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { mountWithIntl, renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { PingListExpandedRowComponent } from './expanded_row'; import { Ping } from '../../../../common/runtime_types'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_headers.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_headers.test.tsx index aa1f85556bc5f..8bc9f2b7fed51 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_headers.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_headers.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { PingHeaders } from './headers'; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/tag_label.test.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/tag_label.test.tsx index 76ec33ccc5fe2..d4dd2f6f0678b 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/tag_label.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/tag_label.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { TagLabel } from './tag_label'; describe('TagLabel component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/status_by_location.test.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/status_by_location.test.tsx index d86b7f13604dd..d7e8f70475f54 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/status_by_location.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/status_by_location.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { MonitorLocation } from '../../../../common/runtime_types'; import { StatusByLocations } from './index'; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/alert_field_number.test.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/alert_field_number.test.tsx index 32e16f1ae88eb..62823b4ca87d6 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/alert_field_number.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/alert_field_number.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { AlertFieldNumber, handleAlertFieldNumberChange } from './alert_field_number'; describe('AlertFieldNumber', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/down_number_select.test.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/down_number_select.test.tsx index 0598b675cab35..1290d4cb4ceba 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/down_number_select.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/down_number_select.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { DownNoExpressionSelect } from './down_number_select'; describe('DownNoExpressionSelect component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx index 4ce9720cfc4ce..87caf3f7cb3b6 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { TimeExpressionSelect } from './time_expression_select'; describe('TimeExpressionSelect component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx index 5b32d9bc01992..f8f9e5a84bc5c 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl, mountWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; import { AddFilterButton } from './add_filter_btn'; import { EuiButtonEmpty, EuiContextMenuItem } from '@elastic/eui'; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx index 5300b218b4d00..f0c41480f5172 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { OldAlertCallOut } from './old_alert_call_out'; describe('OldAlertCallOut', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx index c4de51f68a17a..5f50285063541 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorSummary, makePing } from '../../../../../common/runtime_types'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { IntegrationGroup, extractSummaryValues } from './actions_popover/integration_group'; describe('IntegrationGroup', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx index dacdf38b1207f..7f4926f994b1f 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { IntegrationLink } from './actions_popover/integration_link'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; describe('IntegrationLink component', () => { it('renders without errors', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx index f0f330807ffbf..111a8a18ccad5 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl, renderWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl, renderWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import moment from 'moment'; import { BrowserRouter as Router } from 'react-router-dom'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.test.tsx index c8da376a7a8cd..9b7e2a1917835 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorListPageSizeSelectComponent } from './monitor_list_page_size_select'; -import { mountWithIntl } from '@kbn/test/jest'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; describe('MonitorListPageSizeSelect', () => { it('updates the state when selection changes', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.test.tsx b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.test.tsx index 184f6b73cc7ab..3cea8199544d4 100644 --- a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { SnapshotComponent } from './snapshot'; import { Snapshot } from '../../../../common/runtime_types/snapshot'; import * as hook from './use_snap_shot'; diff --git a/x-pack/plugins/uptime/public/components/overview/snapshot_heading.test.tsx b/x-pack/plugins/uptime/public/components/overview/snapshot_heading.test.tsx index 04874a4177e07..f3616345a6f9b 100644 --- a/x-pack/plugins/uptime/public/components/overview/snapshot_heading.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/snapshot_heading.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { SnapshotHeading } from './snapshot/snapshot_heading'; diff --git a/x-pack/plugins/uptime/public/components/overview/synthetics_callout.test.tsx b/x-pack/plugins/uptime/public/components/overview/synthetics_callout.test.tsx index ec9e5f958ec3a..0d2dc15f55725 100644 --- a/x-pack/plugins/uptime/public/components/overview/synthetics_callout.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/synthetics_callout.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { SyntheticsCallout } from './synthetics_callout'; diff --git a/x-pack/plugins/uptime/public/components/synthetics/console_event.test.tsx b/x-pack/plugins/uptime/public/components/synthetics/console_event.test.tsx index b80613dbfece5..6a3c6d02151ed 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/console_event.test.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/console_event.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { ConsoleEvent } from './console_event'; diff --git a/x-pack/plugins/uptime/public/components/synthetics/empty_journey.test.tsx b/x-pack/plugins/uptime/public/components/synthetics/empty_journey.test.tsx index 854006ba39356..cdbf69af0f874 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/empty_journey.test.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/empty_journey.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test/jest'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { EmptyJourney } from './empty_journey'; diff --git a/x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx b/x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx index 04ecc6bc9c72d..b8e1c055dce49 100644 --- a/x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx +++ b/x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx @@ -10,7 +10,7 @@ import { Router } from 'react-router-dom'; import { MemoryHistory } from 'history/createMemoryHistory'; import { createMemoryHistory, History } from 'history'; // eslint-disable-next-line import/no-extraneous-dependencies -import { mountWithIntl, renderWithIntl, shallowWithIntl } from '@kbn/test/jest'; +import { mountWithIntl, renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import { MountWithReduxProvider } from './helper_with_redux'; import { AppState } from '../../state'; import { mockState } from '../__mocks__/uptime_store.mock'; diff --git a/x-pack/plugins/watcher/__fixtures__/watch.ts b/x-pack/plugins/watcher/__fixtures__/watch.ts index 36991187b6bd4..a05f100c89f19 100644 --- a/x-pack/plugins/watcher/__fixtures__/watch.ts +++ b/x-pack/plugins/watcher/__fixtures__/watch.ts @@ -6,7 +6,7 @@ */ import { Moment } from 'moment'; -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; interface Watch { id: string; diff --git a/x-pack/plugins/watcher/__fixtures__/watch_history.ts b/x-pack/plugins/watcher/__fixtures__/watch_history.ts index 9ebc343fcddd6..d7fab9fc80d29 100644 --- a/x-pack/plugins/watcher/__fixtures__/watch_history.ts +++ b/x-pack/plugins/watcher/__fixtures__/watch_history.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; interface WatchHistory { startTime: string; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/index.ts index 37fe71d143988..07ced2096e696 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/index.ts @@ -11,8 +11,8 @@ import { setup as watchCreateJsonSetup } from './watch_create_json.helpers'; import { setup as watchCreateThresholdSetup } from './watch_create_threshold.helpers'; import { setup as watchEditSetup } from './watch_edit.helpers'; -export type { TestBed } from '@kbn/test/jest'; -export { getRandomString, findTestSubject } from '@kbn/test/jest'; +export type { TestBed } from '@kbn/test-jest-helpers'; +export { getRandomString, findTestSubject } from '@kbn/test-jest-helpers'; export { wrapBodyResponse, unwrapBodyResponse } from './body_response'; export { setupEnvironment } from './setup_environment'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_json.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_json.helpers.ts index a276b717bc544..16e4930510efa 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_json.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_json.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; 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'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts index 320f88eef2651..cbfdac67597e1 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_create_threshold.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; 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'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts index 15489fa0a864d..9f01750d43593 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit.helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test-jest-helpers'; import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit'; import { registerRouter } from '../../../public/application/lib/navigation'; import { ROUTES } from '../../../common/constants'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts index d048a55422f6e..914eaca62465d 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_list.helpers.ts @@ -7,7 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { + registerTestBed, + findTestSubject, + TestBed, + AsyncTestBedConfig, +} from '@kbn/test-jest-helpers'; import { WatchList } from '../../../public/application/sections/watch_list/components/watch_list'; import { ROUTES, REFRESH_INTERVALS } from '../../../common/constants'; import { withAppContext } from './app_context.mock'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts index 0578f9f1092a1..63892961d8b57 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_status.helpers.ts @@ -7,7 +7,12 @@ import { act } from 'react-dom/test-utils'; -import { registerTestBed, findTestSubject, TestBed, AsyncTestBedConfig } from '@kbn/test/jest'; +import { + registerTestBed, + findTestSubject, + TestBed, + AsyncTestBedConfig, +} from '@kbn/test-jest-helpers'; import { WatchStatus } from '../../../public/application/sections/watch_status/components/watch_status'; import { ROUTES } from '../../../common/constants'; import { WATCH_ID } from './jest_constants'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_edit.test.ts b/x-pack/plugins/watcher/__jest__/client_integration/watch_edit.test.ts index b5fb2aa9d915a..37f9838f176af 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_edit.test.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_edit.test.ts @@ -8,7 +8,7 @@ import { act } from 'react-dom/test-utils'; import axiosXhrAdapter from 'axios/lib/adapters/xhr'; import axios from 'axios'; -import { getRandomString } from '@kbn/test/jest'; +import { getRandomString } from '@kbn/test-jest-helpers'; import { getWatch } from '../../__fixtures__'; import { defaultWatch } from '../../public/application/models/watch'; diff --git a/yarn.lock b/yarn.lock index 6e0e20d55a1b1..6595fa5871aa7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3942,6 +3942,10 @@ version "0.0.0" uid "" +"@kbn/test-jest-helpers@link:bazel-bin/packages/kbn-test-jest-helpers": + version "0.0.0" + uid "" + "@kbn/test-subj-selector@link:bazel-bin/packages/kbn-test-subj-selector": version "0.0.0" uid "" @@ -6898,6 +6902,14 @@ version "0.0.0" uid "" +"@types/kbn__test-jest-helpers@link:bazel-bin/packages/kbn-test-jest-helpers/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__test@link:bazel-bin/packages/kbn-test/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__ui-shared-deps-npm@link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types": version "0.0.0" uid ""