From f5288d4e3e2f171914f7715246176728caf152af Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 6 Jan 2021 18:04:57 +0000 Subject: [PATCH] chore(NA): move apm plugin tests out of __tests__ folder --- .../List/{__test__ => }/List.test.tsx | 10 +++++----- .../List/{__test__ => __fixtures__}/props.json | 0 .../__snapshots__/List.test.tsx.snap | 0 .../{__tests__ => }/SelectableUrlList.test.tsx | 6 +++--- .../{__tests__ => }/FormatToSec.test.ts | 2 +- .../{__tests__ => }/KeyUXMetrics.test.tsx | 4 ++-- .../{__tests__ => }/EmbeddedMap.test.tsx | 6 +++--- .../{__tests__ => }/MapToolTip.test.tsx | 2 +- .../__mocks__/regions_layer.mock.ts | 0 .../__snapshots__/EmbeddedMap.test.tsx.snap | 0 .../__snapshots__/MapToolTip.test.tsx.snap | 0 .../{__tests__ => }/useLayerList.test.ts | 2 +- .../{__test__ => }/distribution.test.ts | 2 +- .../{__test__ => }/get_agent_marks.test.ts | 4 ++-- .../{__test__ => }/get_error_marks.test.ts | 4 ++-- .../service_inventory.test.tsx | 2 +- .../ImpactBar/{__test__ => }/ImpactBar.test.js | 2 +- .../__snapshots__/ImpactBar.test.js.snap | 0 .../{__test__ => }/KeyValueTable.test.tsx | 4 ++-- .../DiscoverErrorButton.test.tsx | 4 ++-- .../{__test__ => }/DiscoverErrorLink.test.tsx | 4 ++-- .../DiscoverLinks.integration.test.tsx | 14 +++++++------- .../DiscoverTransactionLink.test.tsx | 4 ++-- .../mock_transaction.json | 0 .../DiscoverErrorButton.test.tsx.snap | 0 .../DiscoverErrorLink.test.tsx.snap | 0 .../DiscoverTransactionLink.test.tsx.snap | 0 .../discover_transaction_button.test.tsx.snap | 0 .../discover_transaction_button.test.tsx | 6 +++--- .../{__test__ => }/ManagedTable.test.js | 2 +- .../__snapshots__/ManagedTable.test.js.snap | 0 .../{__test__ => }/ErrorMetadata.test.tsx | 8 ++++---- .../{__test__ => }/MetadataTable.test.tsx | 8 ++++---- .../{__test__ => }/Section.test.tsx | 4 ++-- .../{__test__ => }/SpanMetadata.test.tsx | 8 ++++---- .../TransactionMetadata.test.tsx | 8 ++++---- .../{__test__ => }/helper.test.ts | 6 +++--- .../ErrorCountSummaryItemBadge.test.tsx | 4 ++-- .../HttpInfoSummaryItem.test.tsx | 4 ++-- .../{__test__ => }/HttpStatusBadge.test.tsx | 4 ++-- .../{__test__ => }/index.test.tsx | 4 ++-- .../TransactionActionMenu.test.tsx | 18 +++++++++--------- .../{__test__ => __fixtures__}/mockData.ts | 0 .../TransactionActionMenu.test.tsx.snap | 0 .../{__test__ => }/sections.test.ts | 4 ++-- .../SessionStorageMock.ts | 0 .../services/{__test__ => }/callApi.test.ts | 6 +++--- .../services/{__test__ => }/callApmApi.test.ts | 4 ++-- .../utils/{__test__ => }/flattenObject.test.ts | 2 +- .../__snapshots__/get_buckets.test.ts.snap | 0 .../{__tests__ => }/get_buckets.test.ts | 6 +++--- .../get_environment_ui_filter_es.test.ts | 6 +++--- 52 files changed, 94 insertions(+), 94 deletions(-) rename x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/{__test__ => }/List.test.tsx (78%) rename x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/{__test__ => __fixtures__}/props.json (100%) rename x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/{__test__ => }/__snapshots__/List.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/{__tests__ => }/SelectableUrlList.test.tsx (86%) rename x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/{__tests__ => }/FormatToSec.test.ts (94%) rename x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/{__tests__ => }/KeyUXMetrics.test.tsx (93%) rename x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/{__tests__ => }/EmbeddedMap.test.tsx (79%) rename x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/{__tests__ => }/MapToolTip.test.tsx (93%) rename x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/{__tests__ => }/__mocks__/regions_layer.mock.ts (100%) rename x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/{__tests__ => }/__snapshots__/EmbeddedMap.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/{__tests__ => }/__snapshots__/MapToolTip.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/{__tests__ => }/useLayerList.test.ts (92%) rename x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/{__test__ => }/distribution.test.ts (96%) rename x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/{__test__ => }/get_agent_marks.test.ts (90%) rename x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/{__test__ => }/get_error_marks.test.ts (94%) rename x-pack/plugins/apm/public/components/shared/ImpactBar/{__test__ => }/ImpactBar.test.js (95%) rename x-pack/plugins/apm/public/components/shared/ImpactBar/{__test__ => }/__snapshots__/ImpactBar.test.js.snap (100%) rename x-pack/plugins/apm/public/components/shared/KeyValueTable/{__test__ => }/KeyValueTable.test.tsx (94%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/DiscoverErrorButton.test.tsx (92%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/DiscoverErrorLink.test.tsx (92%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/DiscoverLinks.integration.test.tsx (87%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/DiscoverTransactionLink.test.tsx (84%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => __fixtures__}/mock_transaction.json (100%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/__snapshots__/DiscoverErrorButton.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/__snapshots__/DiscoverErrorLink.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/__snapshots__/DiscoverTransactionLink.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/__snapshots__/discover_transaction_button.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/{__test__ => }/discover_transaction_button.test.tsx (82%) rename x-pack/plugins/apm/public/components/shared/ManagedTable/{__test__ => }/ManagedTable.test.js (96%) rename x-pack/plugins/apm/public/components/shared/ManagedTable/{__test__ => }/__snapshots__/ManagedTable.test.js.snap (100%) rename x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/{__test__ => }/ErrorMetadata.test.tsx (92%) rename x-pack/plugins/apm/public/components/shared/MetadataTable/{__test__ => }/MetadataTable.test.tsx (87%) rename x-pack/plugins/apm/public/components/shared/MetadataTable/{__test__ => }/Section.test.tsx (83%) rename x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/{__test__ => }/SpanMetadata.test.tsx (92%) rename x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/{__test__ => }/TransactionMetadata.test.tsx (93%) rename x-pack/plugins/apm/public/components/shared/MetadataTable/{__test__ => }/helper.test.ts (92%) rename x-pack/plugins/apm/public/components/shared/Summary/{__test__ => }/ErrorCountSummaryItemBadge.test.tsx (86%) rename x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/{__test__ => }/HttpInfoSummaryItem.test.tsx (95%) rename x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/{__test__ => }/HttpStatusBadge.test.tsx (95%) rename x-pack/plugins/apm/public/components/shared/TimestampTooltip/{__test__ => }/index.test.tsx (94%) rename x-pack/plugins/apm/public/components/shared/TransactionActionMenu/{__test__ => }/TransactionActionMenu.test.tsx (95%) rename x-pack/plugins/apm/public/components/shared/TransactionActionMenu/{__test__ => __fixtures__}/mockData.ts (100%) rename x-pack/plugins/apm/public/components/shared/TransactionActionMenu/{__test__ => }/__snapshots__/TransactionActionMenu.test.tsx.snap (100%) rename x-pack/plugins/apm/public/components/shared/TransactionActionMenu/{__test__ => }/sections.test.ts (98%) rename x-pack/plugins/apm/public/services/{__test__ => __mocks__}/SessionStorageMock.ts (100%) rename x-pack/plugins/apm/public/services/{__test__ => }/callApi.test.ts (97%) rename x-pack/plugins/apm/public/services/{__test__ => }/callApmApi.test.ts (93%) rename x-pack/plugins/apm/public/utils/{__test__ => }/flattenObject.test.ts (96%) rename x-pack/plugins/apm/server/lib/errors/distribution/{__tests__ => }/__snapshots__/get_buckets.test.ts.snap (100%) rename x-pack/plugins/apm/server/lib/errors/distribution/{__tests__ => }/get_buckets.test.ts (92%) rename x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/{__test__ => }/get_environment_ui_filter_es.test.ts (80%) diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/List.test.tsx similarity index 78% rename from x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx rename to x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/List.test.tsx index 4022caedadaab..e6555ed900a6d 100644 --- a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/List.test.tsx +++ b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/List.test.tsx @@ -6,11 +6,11 @@ import { mount } from 'enzyme'; import React from 'react'; -import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; -import { MockUrlParamsContextProvider } from '../../../../../context/url_params_context/mock_url_params_context_provider'; -import { mockMoment, toJson } from '../../../../../utils/testHelpers'; -import { ErrorGroupList } from '../index'; -import props from './props.json'; +import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; +import { MockUrlParamsContextProvider } from '../../../../context/url_params_context/mock_url_params_context_provider'; +import { mockMoment, toJson } from '../../../../utils/testHelpers'; +import { ErrorGroupList } from './index'; +import props from './__fixtures__/props.json'; import { MemoryRouter } from 'react-router-dom'; jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => { diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/props.json b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__fixtures__/props.json similarity index 100% rename from x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/props.json rename to x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__fixtures__/props.json diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap b/x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__snapshots__/List.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap rename to x-pack/plugins/apm/public/components/app/ErrorGroupOverview/List/__snapshots__/List.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/__tests__/SelectableUrlList.test.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/SelectableUrlList.test.tsx similarity index 86% rename from x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/__tests__/SelectableUrlList.test.tsx rename to x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/SelectableUrlList.test.tsx index a492938deffab..c469a2c21c34a 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/__tests__/SelectableUrlList.test.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/SelectableUrlList.test.tsx @@ -5,9 +5,9 @@ */ import React from 'react'; import { createMemoryHistory } from 'history'; -import * as fetcherHook from '../../../../../../hooks/use_fetcher'; -import { SelectableUrlList } from '../SelectableUrlList'; -import { render } from '../../../utils/test_helper'; +import * as fetcherHook from '../../../../../hooks/use_fetcher'; +import { SelectableUrlList } from './SelectableUrlList'; +import { render } from '../../utils/test_helper'; describe('SelectableUrlList', () => { it('it uses search term value from url', () => { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/__tests__/FormatToSec.test.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/FormatToSec.test.ts similarity index 94% rename from x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/__tests__/FormatToSec.test.ts rename to x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/FormatToSec.test.ts index 6cdf469d980fa..764d662615031 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/__tests__/FormatToSec.test.ts +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/FormatToSec.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { formatToSec } from '../KeyUXMetrics'; +import { formatToSec } from './KeyUXMetrics'; describe('FormatToSec', () => { test('it returns the expected value', () => { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/__tests__/KeyUXMetrics.test.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.test.tsx similarity index 93% rename from x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/__tests__/KeyUXMetrics.test.tsx rename to x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.test.tsx index 5d73cbc4cd3c8..804eeaec26655 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/__tests__/KeyUXMetrics.test.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.test.tsx @@ -5,8 +5,8 @@ */ import React from 'react'; import { render } from '@testing-library/react'; -import * as fetcherHook from '../../../../../hooks/use_fetcher'; -import { KeyUXMetrics } from '../KeyUXMetrics'; +import * as fetcherHook from '../../../../hooks/use_fetcher'; +import { KeyUXMetrics } from './KeyUXMetrics'; describe('KeyUXMetrics', () => { it('renders metrics with correct formats', () => { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/EmbeddedMap.test.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.test.tsx similarity index 79% rename from x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/EmbeddedMap.test.tsx rename to x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.test.tsx index 388a8824bc73d..125c57f514a59 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/EmbeddedMap.test.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/EmbeddedMap.test.tsx @@ -7,9 +7,9 @@ import { render } from 'enzyme'; import React from 'react'; -import { EmbeddedMap } from '../EmbeddedMap'; -import { KibanaContextProvider } from '../../../../../../../../../src/plugins/kibana_react/public'; -import { embeddablePluginMock } from '../../../../../../../../../src/plugins/embeddable/public/mocks'; +import { EmbeddedMap } from './EmbeddedMap'; +import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public'; +import { embeddablePluginMock } from '../../../../../../../../src/plugins/embeddable/public/mocks'; describe('Embedded Map', () => { test('it renders', () => { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/MapToolTip.test.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.test.tsx similarity index 93% rename from x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/MapToolTip.test.tsx rename to x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.test.tsx index cbaae40b04361..89f20bf24ccba 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/MapToolTip.test.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/MapToolTip.test.tsx @@ -7,7 +7,7 @@ import { render, shallow } from 'enzyme'; import React from 'react'; -import { MapToolTip } from '../MapToolTip'; +import { MapToolTip } from './MapToolTip'; describe('Map Tooltip', () => { test('it shallow renders', () => { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/__mocks__/regions_layer.mock.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__mocks__/regions_layer.mock.ts similarity index 100% rename from x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/__mocks__/regions_layer.mock.ts rename to x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__mocks__/regions_layer.mock.ts diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/__snapshots__/EmbeddedMap.test.tsx.snap b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__snapshots__/EmbeddedMap.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/__snapshots__/EmbeddedMap.test.tsx.snap rename to x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__snapshots__/EmbeddedMap.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/__snapshots__/MapToolTip.test.tsx.snap b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__snapshots__/MapToolTip.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/__snapshots__/MapToolTip.test.tsx.snap rename to x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__snapshots__/MapToolTip.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/useLayerList.test.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/useLayerList.test.ts similarity index 92% rename from x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/useLayerList.test.ts rename to x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/useLayerList.test.ts index 872553452b263..a63ab11263e5f 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/__tests__/useLayerList.test.ts +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdownMap/useLayerList.test.ts @@ -6,7 +6,7 @@ import { renderHook } from '@testing-library/react-hooks'; import { mockLayerList } from './__mocks__/regions_layer.mock'; -import { useLayerList } from '../useLayerList'; +import { useLayerList } from './useLayerList'; describe('useLayerList', () => { test('it returns the region layer', () => { diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/__test__/distribution.test.ts b/x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/distribution.test.ts similarity index 96% rename from x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/__test__/distribution.test.ts rename to x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/distribution.test.ts index 1586e1f4903a2..0453b113f41de 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/__test__/distribution.test.ts +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Distribution/distribution.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getFormattedBuckets } from '../index'; +import { getFormattedBuckets } from './index'; describe('Distribution', () => { it('getFormattedBuckets', () => { diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/__test__/get_agent_marks.test.ts b/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/get_agent_marks.test.ts similarity index 90% rename from x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/__test__/get_agent_marks.test.ts rename to x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/get_agent_marks.test.ts index 72533cf2930d2..7666db35d43cf 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/__test__/get_agent_marks.test.ts +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/get_agent_marks.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction'; -import { getAgentMarks } from '../get_agent_marks'; +import { Transaction } from '../../../../../../../typings/es_schemas/ui/transaction'; +import { getAgentMarks } from './get_agent_marks'; describe('getAgentMarks', () => { it('should sort the marks by time', () => { diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/__test__/get_error_marks.test.ts b/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/get_error_marks.test.ts similarity index 94% rename from x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/__test__/get_error_marks.test.ts rename to x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/get_error_marks.test.ts index abfecc3f70d24..0eb7a5b89aa3a 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/__test__/get_error_marks.test.ts +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Marks/get_error_marks.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IWaterfallError } from '../../Waterfall/waterfall_helpers/waterfall_helpers'; -import { getErrorMarks } from '../get_error_marks'; +import { IWaterfallError } from '../Waterfall/waterfall_helpers/waterfall_helpers'; +import { getErrorMarks } from './get_error_marks'; describe('getErrorMarks', () => { describe('returns empty array', () => { diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx index 6bb1ea2919c16..e501dd3bb7a56 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx @@ -21,7 +21,7 @@ import { import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import * as useLocalUIFilters from '../../../hooks/useLocalUIFilters'; import * as useDynamicIndexPatternHooks from '../../../hooks/use_dynamic_index_pattern'; -import { SessionStorageMock } from '../../../services/__test__/SessionStorageMock'; +import { SessionStorageMock } from '../../../services/__mocks__/SessionStorageMock'; import { MockUrlParamsContextProvider } from '../../../context/url_params_context/mock_url_params_context_provider'; import * as hook from './use_anomaly_detection_jobs_fetcher'; diff --git a/x-pack/plugins/apm/public/components/shared/ImpactBar/__test__/ImpactBar.test.js b/x-pack/plugins/apm/public/components/shared/ImpactBar/ImpactBar.test.js similarity index 95% rename from x-pack/plugins/apm/public/components/shared/ImpactBar/__test__/ImpactBar.test.js rename to x-pack/plugins/apm/public/components/shared/ImpactBar/ImpactBar.test.js index d4b3f223f726f..4e94ea85c120b 100644 --- a/x-pack/plugins/apm/public/components/shared/ImpactBar/__test__/ImpactBar.test.js +++ b/x-pack/plugins/apm/public/components/shared/ImpactBar/ImpactBar.test.js @@ -6,7 +6,7 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { ImpactBar } from '..'; +import { ImpactBar } from '.'; describe('ImpactBar component', () => { it('should render with default values', () => { diff --git a/x-pack/plugins/apm/public/components/shared/ImpactBar/__test__/__snapshots__/ImpactBar.test.js.snap b/x-pack/plugins/apm/public/components/shared/ImpactBar/__snapshots__/ImpactBar.test.js.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/ImpactBar/__test__/__snapshots__/ImpactBar.test.js.snap rename to x-pack/plugins/apm/public/components/shared/ImpactBar/__snapshots__/ImpactBar.test.js.snap diff --git a/x-pack/plugins/apm/public/components/shared/KeyValueTable/__test__/KeyValueTable.test.tsx b/x-pack/plugins/apm/public/components/shared/KeyValueTable/KeyValueTable.test.tsx similarity index 94% rename from x-pack/plugins/apm/public/components/shared/KeyValueTable/__test__/KeyValueTable.test.tsx rename to x-pack/plugins/apm/public/components/shared/KeyValueTable/KeyValueTable.test.tsx index 5a9e8809ea734..a08ade8e559d0 100644 --- a/x-pack/plugins/apm/public/components/shared/KeyValueTable/__test__/KeyValueTable.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/KeyValueTable/KeyValueTable.test.tsx @@ -5,9 +5,9 @@ */ import React from 'react'; -import { KeyValueTable } from '..'; +import { KeyValueTable } from '.'; import { render } from '@testing-library/react'; -import { renderWithTheme } from '../../../../utils/testHelpers'; +import { renderWithTheme } from '../../../utils/testHelpers'; function getKeys(output: ReturnType) { const keys = output.getAllByTestId('dot-key'); diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverErrorButton.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorButton.test.tsx similarity index 92% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverErrorButton.test.tsx rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorButton.test.tsx index f71c8b71aa2ee..3a41c19c53f6d 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverErrorButton.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorButton.test.tsx @@ -6,8 +6,8 @@ import { shallow, ShallowWrapper } from 'enzyme'; import React from 'react'; -import { APMError } from '../../../../../../typings/es_schemas/ui/apm_error'; -import { DiscoverErrorLink } from '../DiscoverErrorLink'; +import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; +import { DiscoverErrorLink } from './DiscoverErrorLink'; describe('DiscoverErrorLink without kuery', () => { let wrapper: ShallowWrapper; diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverErrorLink.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.test.tsx similarity index 92% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverErrorLink.test.tsx rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.test.tsx index f71c8b71aa2ee..3a41c19c53f6d 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverErrorLink.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.test.tsx @@ -6,8 +6,8 @@ import { shallow, ShallowWrapper } from 'enzyme'; import React from 'react'; -import { APMError } from '../../../../../../typings/es_schemas/ui/apm_error'; -import { DiscoverErrorLink } from '../DiscoverErrorLink'; +import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; +import { DiscoverErrorLink } from './DiscoverErrorLink'; describe('DiscoverErrorLink without kuery', () => { let wrapper: ShallowWrapper; diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverLinks.integration.test.tsx similarity index 87% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverLinks.integration.test.tsx index ca02abc395992..e77d4d7185273 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverLinks.integration.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverLinks.integration.test.tsx @@ -6,13 +6,13 @@ import { Location } from 'history'; import React from 'react'; -import { APMError } from '../../../../../../typings/es_schemas/ui/apm_error'; -import { Span } from '../../../../../../typings/es_schemas/ui/span'; -import { Transaction } from '../../../../../../typings/es_schemas/ui/transaction'; -import { getRenderedHref } from '../../../../../utils/testHelpers'; -import { DiscoverErrorLink } from '../DiscoverErrorLink'; -import { DiscoverSpanLink } from '../DiscoverSpanLink'; -import { DiscoverTransactionLink } from '../DiscoverTransactionLink'; +import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; +import { Span } from '../../../../../typings/es_schemas/ui/span'; +import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; +import { getRenderedHref } from '../../../../utils/testHelpers'; +import { DiscoverErrorLink } from './DiscoverErrorLink'; +import { DiscoverSpanLink } from './DiscoverSpanLink'; +import { DiscoverTransactionLink } from './DiscoverTransactionLink'; describe('DiscoverLinks', () => { it('produces the correct URL for a transaction', async () => { diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverTransactionLink.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.test.tsx similarity index 84% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverTransactionLink.test.tsx rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.test.tsx index 48d8bb2b41644..0ded3fb6619e3 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/DiscoverTransactionLink.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.test.tsx @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Transaction } from '../../../../../../typings/es_schemas/ui/transaction'; +import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; // @ts-expect-error import configureStore from '../../../../../store/config/configureStore'; -import { getDiscoverQuery } from '../DiscoverTransactionLink'; +import { getDiscoverQuery } from './DiscoverTransactionLink'; function getMockTransaction() { return { diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/mock_transaction.json b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__fixtures__/mock_transaction.json similarity index 100% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/mock_transaction.json rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__fixtures__/mock_transaction.json diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/DiscoverErrorButton.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/DiscoverErrorButton.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/DiscoverErrorButton.test.tsx.snap rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/DiscoverErrorButton.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/DiscoverErrorLink.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/DiscoverErrorLink.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/DiscoverErrorLink.test.tsx.snap rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/DiscoverErrorLink.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/DiscoverTransactionLink.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/DiscoverTransactionLink.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/DiscoverTransactionLink.test.tsx.snap rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/DiscoverTransactionLink.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/discover_transaction_button.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/discover_transaction_button.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/__snapshots__/discover_transaction_button.test.tsx.snap rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__snapshots__/discover_transaction_button.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/discover_transaction_button.test.tsx b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/discover_transaction_button.test.tsx similarity index 82% rename from x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/discover_transaction_button.test.tsx rename to x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/discover_transaction_button.test.tsx index 4a68a5c0b4904..75fe18913618d 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/__test__/discover_transaction_button.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/DiscoverLinks/discover_transaction_button.test.tsx @@ -6,12 +6,12 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { Transaction } from '../../../../../../typings/es_schemas/ui/transaction'; +import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; import { DiscoverTransactionLink, getDiscoverQuery, -} from '../DiscoverTransactionLink'; -import mockTransaction from './mock_transaction.json'; +} from './DiscoverTransactionLink'; +import mockTransaction from './__fixtures__/mock_transaction.json'; describe('DiscoverTransactionLink component', () => { it('should render with data', () => { diff --git a/x-pack/plugins/apm/public/components/shared/ManagedTable/__test__/ManagedTable.test.js b/x-pack/plugins/apm/public/components/shared/ManagedTable/ManagedTable.test.js similarity index 96% rename from x-pack/plugins/apm/public/components/shared/ManagedTable/__test__/ManagedTable.test.js rename to x-pack/plugins/apm/public/components/shared/ManagedTable/ManagedTable.test.js index 38f260b04e252..88e1c57e62354 100644 --- a/x-pack/plugins/apm/public/components/shared/ManagedTable/__test__/ManagedTable.test.js +++ b/x-pack/plugins/apm/public/components/shared/ManagedTable/ManagedTable.test.js @@ -6,7 +6,7 @@ import { shallow } from 'enzyme'; import React from 'react'; -import { UnoptimizedManagedTable } from '..'; +import { UnoptimizedManagedTable } from '.'; describe('ManagedTable component', () => { let people; diff --git a/x-pack/plugins/apm/public/components/shared/ManagedTable/__test__/__snapshots__/ManagedTable.test.js.snap b/x-pack/plugins/apm/public/components/shared/ManagedTable/__snapshots__/ManagedTable.test.js.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/ManagedTable/__test__/__snapshots__/ManagedTable.test.js.snap rename to x-pack/plugins/apm/public/components/shared/ManagedTable/__snapshots__/ManagedTable.test.js.snap diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/__test__/ErrorMetadata.test.tsx b/x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/ErrorMetadata.test.tsx similarity index 92% rename from x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/__test__/ErrorMetadata.test.tsx rename to x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/ErrorMetadata.test.tsx index 8f44d98cecdf7..8a50bc2cde520 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/__test__/ErrorMetadata.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/ErrorMetadata.test.tsx @@ -7,13 +7,13 @@ import { render } from '@testing-library/react'; import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { ErrorMetadata } from '..'; -import { APMError } from '../../../../../../typings/es_schemas/ui/apm_error'; -import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; +import { ErrorMetadata } from '.'; +import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; +import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; import { expectTextsInDocument, expectTextsNotInDocument, -} from '../../../../../utils/testHelpers'; +} from '../../../../utils/testHelpers'; function Wrapper({ children }: { children?: ReactNode }) { return ( diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/MetadataTable.test.tsx b/x-pack/plugins/apm/public/components/shared/MetadataTable/MetadataTable.test.tsx similarity index 87% rename from x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/MetadataTable.test.tsx rename to x-pack/plugins/apm/public/components/shared/MetadataTable/MetadataTable.test.tsx index 8a4cd588c8260..9bd3278033f92 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/MetadataTable.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/MetadataTable.test.tsx @@ -7,10 +7,10 @@ import { render } from '@testing-library/react'; import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { MetadataTable } from '..'; -import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; -import { expectTextsInDocument } from '../../../../utils/testHelpers'; -import { SectionsWithRows } from '../helper'; +import { MetadataTable } from '.'; +import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context'; +import { expectTextsInDocument } from '../../../utils/testHelpers'; +import { SectionsWithRows } from './helper'; function Wrapper({ children }: { children?: ReactNode }) { return ( diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/Section.test.tsx b/x-pack/plugins/apm/public/components/shared/MetadataTable/Section.test.tsx similarity index 83% rename from x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/Section.test.tsx rename to x-pack/plugins/apm/public/components/shared/MetadataTable/Section.test.tsx index 7a150f81580d8..3dd19778430b7 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/Section.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/Section.test.tsx @@ -5,8 +5,8 @@ */ import React from 'react'; import { render } from '@testing-library/react'; -import { Section } from '../Section'; -import { expectTextsInDocument } from '../../../../utils/testHelpers'; +import { Section } from './Section'; +import { expectTextsInDocument } from '../../../utils/testHelpers'; describe('Section', () => { it('shows "empty state message" if no data is available', () => { diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx b/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/SpanMetadata.test.tsx similarity index 92% rename from x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx rename to x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/SpanMetadata.test.tsx index c97e506187347..c9ed2c4c2b32f 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/SpanMetadata.test.tsx @@ -7,13 +7,13 @@ import { render } from '@testing-library/react'; import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { SpanMetadata } from '..'; -import { Span } from '../../../../../../typings/es_schemas/ui/span'; -import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; +import { SpanMetadata } from '.'; +import { Span } from '../../../../../typings/es_schemas/ui/span'; +import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; import { expectTextsInDocument, expectTextsNotInDocument, -} from '../../../../../utils/testHelpers'; +} from '../../../../utils/testHelpers'; function Wrapper({ children }: { children?: ReactNode }) { return ( diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx b/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/TransactionMetadata.test.tsx similarity index 93% rename from x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx rename to x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/TransactionMetadata.test.tsx index 4080a300ba17f..6a5a122f23954 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/TransactionMetadata.test.tsx @@ -7,13 +7,13 @@ import { render } from '@testing-library/react'; import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { TransactionMetadata } from '..'; -import { Transaction } from '../../../../../../typings/es_schemas/ui/transaction'; -import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; +import { TransactionMetadata } from '.'; +import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; +import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; import { expectTextsInDocument, expectTextsNotInDocument, -} from '../../../../../utils/testHelpers'; +} from '../../../../utils/testHelpers'; function Wrapper({ children }: { children?: ReactNode }) { return ( diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/helper.test.ts b/x-pack/plugins/apm/public/components/shared/MetadataTable/helper.test.ts similarity index 92% rename from x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/helper.test.ts rename to x-pack/plugins/apm/public/components/shared/MetadataTable/helper.test.ts index ac776e0b8980c..8f3e675c7aeae 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/__test__/helper.test.ts +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/helper.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getSectionsWithRows, filterSectionsByTerm } from '../helper'; -import { LABELS, HTTP, SERVICE } from '../sections'; -import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; +import { getSectionsWithRows, filterSectionsByTerm } from './helper'; +import { LABELS, HTTP, SERVICE } from './sections'; +import { Transaction } from '../../../../typings/es_schemas/ui/transaction'; describe('MetadataTable Helper', () => { const sections = [ diff --git a/x-pack/plugins/apm/public/components/shared/Summary/__test__/ErrorCountSummaryItemBadge.test.tsx b/x-pack/plugins/apm/public/components/shared/Summary/ErrorCountSummaryItemBadge.test.tsx similarity index 86% rename from x-pack/plugins/apm/public/components/shared/Summary/__test__/ErrorCountSummaryItemBadge.test.tsx rename to x-pack/plugins/apm/public/components/shared/Summary/ErrorCountSummaryItemBadge.test.tsx index 26087e1fd85cc..fd531f79c9ac6 100644 --- a/x-pack/plugins/apm/public/components/shared/Summary/__test__/ErrorCountSummaryItemBadge.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Summary/ErrorCountSummaryItemBadge.test.tsx @@ -5,11 +5,11 @@ */ import React from 'react'; -import { ErrorCountSummaryItemBadge } from '../ErrorCountSummaryItemBadge'; +import { ErrorCountSummaryItemBadge } from './ErrorCountSummaryItemBadge'; import { expectTextsInDocument, renderWithTheme, -} from '../../../../utils/testHelpers'; +} from '../../../utils/testHelpers'; describe('ErrorCountSummaryItemBadge', () => { it('shows singular error message', () => { diff --git a/x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/__test__/HttpInfoSummaryItem.test.tsx b/x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/HttpInfoSummaryItem.test.tsx similarity index 95% rename from x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/__test__/HttpInfoSummaryItem.test.tsx rename to x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/HttpInfoSummaryItem.test.tsx index d0e1f08aabbbc..9465d94e16dc8 100644 --- a/x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/__test__/HttpInfoSummaryItem.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Summary/HttpInfoSummaryItem/HttpInfoSummaryItem.test.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; -import { HttpInfoSummaryItem } from '../'; -import * as exampleTransactions from '../../__fixtures__/transactions'; +import { HttpInfoSummaryItem } from '.'; +import * as exampleTransactions from '../__fixtures__/transactions'; describe('HttpInfoSummaryItem', () => { describe('render', () => { diff --git a/x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/__test__/HttpStatusBadge.test.tsx b/x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/HttpStatusBadge.test.tsx similarity index 95% rename from x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/__test__/HttpStatusBadge.test.tsx rename to x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/HttpStatusBadge.test.tsx index ecbf41486a3fd..0df23883d3127 100644 --- a/x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/__test__/HttpStatusBadge.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/HttpStatusBadge.test.tsx @@ -6,13 +6,13 @@ import React from 'react'; import { mount } from 'enzyme'; -import { HttpStatusBadge } from '../index'; +import { HttpStatusBadge } from './index'; import { successColor, neutralColor, warningColor, errorColor, -} from '../../../../../utils/httpStatusCodeToColor'; +} from '../../../../utils/httpStatusCodeToColor'; describe('HttpStatusBadge', () => { describe('render', () => { diff --git a/x-pack/plugins/apm/public/components/shared/TimestampTooltip/__test__/index.test.tsx b/x-pack/plugins/apm/public/components/shared/TimestampTooltip/index.test.tsx similarity index 94% rename from x-pack/plugins/apm/public/components/shared/TimestampTooltip/__test__/index.test.tsx rename to x-pack/plugins/apm/public/components/shared/TimestampTooltip/index.test.tsx index b4678b287dc16..dd36827ea94f2 100644 --- a/x-pack/plugins/apm/public/components/shared/TimestampTooltip/__test__/index.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/TimestampTooltip/index.test.tsx @@ -7,8 +7,8 @@ import { shallow } from 'enzyme'; import React from 'react'; import moment from 'moment-timezone'; -import { TimestampTooltip } from '../index'; -import { mockNow } from '../../../../utils/testHelpers'; +import { TimestampTooltip } from './index'; +import { mockNow } from '../../../utils/testHelpers'; describe('TimestampTooltip', () => { const timestamp = 1570720000123; // Oct 10, 2019, 08:06:40.123 (UTC-7) diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.test.tsx similarity index 95% rename from x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx rename to x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.test.tsx index 8cb863c8fc385..6ff395db594f1 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/TransactionActionMenu.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.test.tsx @@ -7,18 +7,18 @@ import { act, fireEvent, render } from '@testing-library/react'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { License } from '../../../../../../licensing/common/license'; -import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; -import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; -import { LicenseContext } from '../../../../context/license/license_context'; -import * as hooks from '../../../../hooks/use_fetcher'; -import * as apmApi from '../../../../services/rest/createCallApmApi'; +import { License } from '../../../../../licensing/common/license'; +import { Transaction } from '../../../../typings/es_schemas/ui/transaction'; +import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context'; +import { LicenseContext } from '../../../context/license/license_context'; +import * as hooks from '../../../hooks/use_fetcher'; +import * as apmApi from '../../../services/rest/createCallApmApi'; import { expectTextsInDocument, expectTextsNotInDocument, -} from '../../../../utils/testHelpers'; -import { TransactionActionMenu } from '../TransactionActionMenu'; -import * as Transactions from './mockData'; +} from '../../../utils/testHelpers'; +import { TransactionActionMenu } from './TransactionActionMenu'; +import * as Transactions from './__fixtures__/mockData'; function Wrapper({ children }: { children?: React.ReactNode }) { return ( diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/mockData.ts b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__fixtures__/mockData.ts similarity index 100% rename from x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/mockData.ts rename to x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__fixtures__/mockData.ts diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/__snapshots__/TransactionActionMenu.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__snapshots__/TransactionActionMenu.test.tsx.snap similarity index 100% rename from x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/__snapshots__/TransactionActionMenu.test.tsx.snap rename to x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__snapshots__/TransactionActionMenu.test.tsx.snap diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.test.ts similarity index 98% rename from x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts rename to x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.test.ts index 048ae9474c403..f6067a34e2b90 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/__test__/sections.test.ts +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/sections.test.ts @@ -5,8 +5,8 @@ */ import { Location } from 'history'; import { IBasePath } from 'kibana/public'; -import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; -import { getSections } from '../sections'; +import { Transaction } from '../../../../typings/es_schemas/ui/transaction'; +import { getSections } from './sections'; describe('Transaction action menu', () => { const basePath = ({ diff --git a/x-pack/plugins/apm/public/services/__test__/SessionStorageMock.ts b/x-pack/plugins/apm/public/services/__mocks__/SessionStorageMock.ts similarity index 100% rename from x-pack/plugins/apm/public/services/__test__/SessionStorageMock.ts rename to x-pack/plugins/apm/public/services/__mocks__/SessionStorageMock.ts diff --git a/x-pack/plugins/apm/public/services/__test__/callApi.test.ts b/x-pack/plugins/apm/public/services/callApi.test.ts similarity index 97% rename from x-pack/plugins/apm/public/services/__test__/callApi.test.ts rename to x-pack/plugins/apm/public/services/callApi.test.ts index f82201bbd4de8..1e606ac4b9aa9 100644 --- a/x-pack/plugins/apm/public/services/__test__/callApi.test.ts +++ b/x-pack/plugins/apm/public/services/callApi.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { mockNow } from '../../utils/testHelpers'; -import { clearCache, callApi } from '../rest/callApi'; -import { SessionStorageMock } from './SessionStorageMock'; +import { mockNow } from '../utils/testHelpers'; +import { clearCache, callApi } from './rest/callApi'; +import { SessionStorageMock } from './__mocks__/SessionStorageMock'; import { HttpSetup } from 'kibana/public'; type HttpMock = HttpSetup & { diff --git a/x-pack/plugins/apm/public/services/__test__/callApmApi.test.ts b/x-pack/plugins/apm/public/services/callApmApi.test.ts similarity index 93% rename from x-pack/plugins/apm/public/services/__test__/callApmApi.test.ts rename to x-pack/plugins/apm/public/services/callApmApi.test.ts index 2307ec9f06bb5..5906053cbd810 100644 --- a/x-pack/plugins/apm/public/services/__test__/callApmApi.test.ts +++ b/x-pack/plugins/apm/public/services/callApmApi.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import * as callApiExports from '../rest/callApi'; -import { createCallApmApi, callApmApi } from '../rest/createCallApmApi'; +import * as callApiExports from './rest/callApi'; +import { createCallApmApi, callApmApi } from './rest/createCallApmApi'; import { HttpSetup } from 'kibana/public'; const callApi = jest diff --git a/x-pack/plugins/apm/public/utils/__test__/flattenObject.test.ts b/x-pack/plugins/apm/public/utils/flattenObject.test.ts similarity index 96% rename from x-pack/plugins/apm/public/utils/__test__/flattenObject.test.ts rename to x-pack/plugins/apm/public/utils/flattenObject.test.ts index a71ecf73bad3f..68f77573949ea 100644 --- a/x-pack/plugins/apm/public/utils/__test__/flattenObject.test.ts +++ b/x-pack/plugins/apm/public/utils/flattenObject.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { flattenObject } from '../flattenObject'; +import { flattenObject } from './flattenObject'; describe('FlattenObject', () => { it('flattens multi level item', () => { diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/__snapshots__/get_buckets.test.ts.snap b/x-pack/plugins/apm/server/lib/errors/distribution/__snapshots__/get_buckets.test.ts.snap similarity index 100% rename from x-pack/plugins/apm/server/lib/errors/distribution/__tests__/__snapshots__/get_buckets.test.ts.snap rename to x-pack/plugins/apm/server/lib/errors/distribution/__snapshots__/get_buckets.test.ts.snap diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts b/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts similarity index 92% rename from x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts rename to x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts index ff7d05efc1802..e05e7d3df2828 100644 --- a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts +++ b/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getBuckets } from '../get_buckets'; -import { APMConfig } from '../../../..'; -import { ProcessorEvent } from '../../../../../common/processor_event'; +import { getBuckets } from './get_buckets'; +import { APMConfig } from '../../..'; +import { ProcessorEvent } from '../../../../common/processor_event'; describe('get buckets', () => { let clientSpy: jest.Mock; diff --git a/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/__test__/get_environment_ui_filter_es.test.ts b/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_environment_ui_filter_es.test.ts similarity index 80% rename from x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/__test__/get_environment_ui_filter_es.test.ts rename to x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_environment_ui_filter_es.test.ts index a319bba1eabe1..711790d0c4aae 100644 --- a/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/__test__/get_environment_ui_filter_es.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/convert_ui_filters/get_environment_ui_filter_es.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getEnvironmentUiFilterES } from '../get_environment_ui_filter_es'; -import { ENVIRONMENT_NOT_DEFINED } from '../../../../../common/environment_filter_values'; -import { SERVICE_ENVIRONMENT } from '../../../../../common/elasticsearch_fieldnames'; +import { getEnvironmentUiFilterES } from './get_environment_ui_filter_es'; +import { ENVIRONMENT_NOT_DEFINED } from '../../../../common/environment_filter_values'; +import { SERVICE_ENVIRONMENT } from '../../../../common/elasticsearch_fieldnames'; describe('getEnvironmentUiFilterES', () => { it('should return empty array, when environment is undefined', () => {