mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Upgrade Assistant] Remove Fix manually heading when there are no manual steps
This commit is contained in:
parent
cd228cd7e4
commit
1b62981a1a
4 changed files with 51 additions and 26 deletions
|
@ -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 = ({
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -55,7 +55,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', () => {
|
||||
|
|
|
@ -192,31 +192,33 @@ export const DeprecationDetailsFlyout = ({
|
|||
</>
|
||||
)}
|
||||
|
||||
<EuiTitle size="s">
|
||||
<h3>{i18nTexts.manualFixTitle}</h3>
|
||||
</EuiTitle>
|
||||
|
||||
<EuiSpacer size="s" />
|
||||
|
||||
<EuiText>
|
||||
{correctiveActions.manualSteps.length === 1 ? (
|
||||
<p data-test-subj="manualStep" className="eui-textBreakWord">
|
||||
{correctiveActions.manualSteps[0]}
|
||||
</p>
|
||||
) : (
|
||||
<ol data-test-subj="manualStepsList">
|
||||
{correctiveActions.manualSteps.map((step, stepIndex) => (
|
||||
<li
|
||||
data-test-subj="manualStepsListItem"
|
||||
key={`step-${stepIndex}`}
|
||||
className="upgResolveStep eui-textBreakWord"
|
||||
>
|
||||
{step}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
)}
|
||||
</EuiText>
|
||||
{correctiveActions.manualSteps.length > 0 && (
|
||||
<>
|
||||
<EuiTitle size="s" data-test-subj="manualStepsTitle">
|
||||
<h3>{i18nTexts.manualFixTitle}</h3>
|
||||
</EuiTitle>
|
||||
<EuiSpacer size="s" />
|
||||
<EuiText>
|
||||
{correctiveActions.manualSteps.length === 1 ? (
|
||||
<p data-test-subj="manualStep" className="eui-textBreakWord">
|
||||
{correctiveActions.manualSteps[0]}
|
||||
</p>
|
||||
) : (
|
||||
<ol data-test-subj="manualStepsList">
|
||||
{correctiveActions.manualSteps.map((step, stepIndex) => (
|
||||
<li
|
||||
data-test-subj="manualStepsListItem"
|
||||
key={`step-${stepIndex}`}
|
||||
className="upgResolveStep eui-textBreakWord"
|
||||
>
|
||||
{step}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
)}
|
||||
</EuiText>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</EuiFlyoutBody>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue