diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/kibana_deprecations_service.mock.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/kibana_deprecations_service.mock.ts index c51e415d7e916d..fb0edcdc875d19 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/kibana_deprecations_service.mock.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/kibana_deprecations_service.mock.ts @@ -34,6 +34,17 @@ const kibanaDeprecations: DomainDeprecationDetails[] = [ message: 'Test deprecation message 2', deprecationType: 'feature', }, + { + correctiveActions: { + // Has no manual steps. + manualSteps: [], + }, + domainId: 'test_domain_3', + level: 'warning', + title: 'Test deprecation title 3', + message: 'Test deprecation message 3', + deprecationType: 'feature', + }, ]; const setLoadDeprecations = ({ diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout.test.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout.test.ts index 1b782ae36181c0..eb76e3c016a395 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout.test.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/kibana_deprecations/deprecation_details_flyout.test.ts @@ -61,6 +61,18 @@ describe('Kibana deprecation details flyout', () => { expect(find('kibanaDeprecationDetails.flyoutTitle').text()).toBe(manualDeprecation.title); expect(find('manualStepsListItem').length).toBe(3); }); + + test(`doesn't show corrective actions title and steps if there aren't any`, async () => { + const { find, exists, actions } = testBed; + const manualDeprecation = mockedKibanaDeprecations[2]; + + await actions.table.clickDeprecationAt(2); + + expect(exists('kibanaDeprecationDetails')).toBe(true); + expect(exists('kibanaDeprecationDetails.manualStepsTitle')).toBe(false); + expect(exists('manualStepsListItem')).toBe(false); + expect(find('kibanaDeprecationDetails.flyoutTitle').text()).toBe(manualDeprecation.title); + }); }); describe('Deprecation with automatic resolution', () => { diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx index 3f72542dc33bfe..c50797d5f4b7bd 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_issues_step/kibana_deprecation_issues.test.tsx @@ -57,7 +57,7 @@ describe('Overview - Fix deprecation issues step - Kibana deprecations', () => { expect(exists('kibanaStatsPanel')).toBe(true); expect(find('kibanaStatsPanel.criticalDeprecations').text()).toContain(1); - expect(find('kibanaStatsPanel.warningDeprecations').text()).toContain(1); + expect(find('kibanaStatsPanel.warningDeprecations').text()).toContain(2); }); test('panel links to Kibana deprecations page', () => { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx index a1242c2da9b0c0..8844386be5081f 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx @@ -192,31 +192,33 @@ export const DeprecationDetailsFlyout = ({ )} - -

{i18nTexts.manualFixTitle}

-
- - - - - {correctiveActions.manualSteps.length === 1 ? ( -

- {correctiveActions.manualSteps[0]} -

- ) : ( -
    - {correctiveActions.manualSteps.map((step, stepIndex) => ( -
  1. - {step} -
  2. - ))} -
- )} -
+ {correctiveActions.manualSteps.length > 0 && ( + <> + +

{i18nTexts.manualFixTitle}

+
+ + + {correctiveActions.manualSteps.length === 1 ? ( +

+ {correctiveActions.manualSteps[0]} +

+ ) : ( +
    + {correctiveActions.manualSteps.map((step, stepIndex) => ( +
  1. + {step} +
  2. + ))} +
+ )} +
+ + )} )}