From d3f480ffdecefbe454eeadcfefb6b218b925db96 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 28 Apr 2021 13:18:33 -0700 Subject: [PATCH] Apply JL's feedback: rename tsx->ts filetypes, fix typo, remove unused TestSubjects type. --- .../client_integration/app/app.helpers.tsx | 3 +-- ...hase.helpers.tsx => cold_phase.helpers.ts} | 0 ...hase.helpers.tsx => warm_phase.helpers.ts} | 0 .../edit_policy/init_test_bed.tsx | 6 +----- .../client_integration/helpers/index.ts | 2 +- .../client_integration/helpers/types.ts | 20 ------------------- .../components/node_allocation.tsx | 2 +- 7 files changed, 4 insertions(+), 29 deletions(-) rename x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/{cold_phase.helpers.tsx => cold_phase.helpers.ts} (100%) rename x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/{warm_phase.helpers.tsx => warm_phase.helpers.ts} (100%) 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 808d8ad238c3e8..77b0372e249944 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 @@ -12,7 +12,6 @@ import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_reac import { createBreadcrumbsMock } from '../../../public/application/services/breadcrumbs.mock'; import { licensingMock } from '../../../../licensing/public/mocks'; import { App } from '../../../public/application/app'; -import { TestSubjects } from '../helpers'; const breadcrumbService = createBreadcrumbsMock(); @@ -37,7 +36,7 @@ const getTestBedConfig = (initialEntries: string[]): TestBedConfig => ({ const initTestBed = (initialEntries: string[]) => registerTestBed(AppWithContext, getTestBedConfig(initialEntries))(); -export interface AppTestBed extends TestBed { +export interface AppTestBed extends TestBed { actions: { clickPolicyNameLink: () => void; clickCreatePolicyButton: () => void; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cold_phase.helpers.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cold_phase.helpers.ts similarity index 100% rename from x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cold_phase.helpers.tsx rename to x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/cold_phase.helpers.ts diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/warm_phase.helpers.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/warm_phase.helpers.ts similarity index 100% rename from x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/warm_phase.helpers.tsx rename to x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/node_allocation/warm_phase.helpers.ts 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 f54f86b8d513db..4f057e04c85d4a 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 @@ -15,7 +15,6 @@ import { EditPolicy } from '../../../public/application/sections/edit_policy'; import { KibanaContextProvider } from '../../../public/shared_imports'; import { AppServicesContext } from '../../../public/types'; import { createBreadcrumbsMock } from '../../../public/application/services/breadcrumbs.mock'; -import { TestSubjects } from '../helpers'; import { POLICY_NAME } from './constants'; const getTestBedConfig = (testBedConfigArgs?: Partial): TestBedConfig => { @@ -52,8 +51,5 @@ export const initTestBed = (arg?: { testBedConfig?: Partial; }) => { const { testBedConfig: testBedConfigArgs, ...rest } = arg || {}; - return registerTestBed( - EditPolicyContainer, - getTestBedConfig(testBedConfigArgs) - )(rest); + return registerTestBed(EditPolicyContainer, getTestBedConfig(testBedConfigArgs))(rest); }; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts index 1509d9b1605592..1388cf97d4e223 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -export { TestSubjects, Phase } from './types'; +export { Phase } from './types'; export { createNodeAllocationActions } from './create_node_allocation_actions'; export { createEnablePhaseAction } from './create_enable_phase_action'; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/types.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/types.ts index 27e767253356d2..644ada96a9f051 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/types.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/types.ts @@ -8,23 +8,3 @@ import { Phases } from '../../../common/types'; export type Phase = keyof Phases; - -export type TestSubjects = - | 'snapshotPolicyCombobox' - | 'savePolicyButton' - | 'customPolicyCallout' - | 'noPoliciesCallout' - | 'policiesErrorCallout' - | 'rolloverSwitch' - | 'rolloverSettingsRequired' - | 'hot-selectedMaxSizeStored' - | 'hot-selectedMaxSizeStoredUnits' - | 'hot-selectedMaxDocuments' - | 'hot-selectedMaxAge' - | 'hot-selectedMaxAgeUnits' - | 'policyTablePolicyNameLink' - | 'policyTitle' - | 'createPolicyButton' - | 'cold-freezeSwitch' - | 'frozen-freezeSwitch' - | string; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx index 109ef12a3bd500..e7b1f7420d1320 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx @@ -69,7 +69,7 @@ export const NodeAllocation: FunctionComponent = ({ let nodeAllocationOptions = []; // On Cloud, allocating to data tiers and allocating to data nodes is mutually exclusive. So we - // only let users select this option if they're using data nodes. Otherwise we remove it.r + // only let users select this option if they're using data nodes. Otherwise we remove it. // // On prem, users should have the freedom to choose this option, even if they're using node roles. // So we always give them this option.