diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx index e248d6d8584f9..63a5cd0d67ae6 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx @@ -31,8 +31,8 @@ describe('when on the policies page', () => { it('should display the onboarding steps', async () => { const renderResult = render(); - const table = await renderResult.findByTestId('onboardingSteps'); - expect(table).not.toBeNull(); + const onboardingSteps = await renderResult.findByTestId('onboardingSteps'); + expect(onboardingSteps).not.toBeNull(); }); describe('when list data loads', () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx index d68b6be925004..2d4abd6de0e42 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx @@ -24,6 +24,7 @@ import { EuiButton, EuiSteps, EuiTitle, + EuiProgress, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -474,54 +475,54 @@ const EmptyPolicyTable = React.memo<{ actionDisabled: boolean; dataTestSubj: string; }>(({ loading, onActionClick, actionDisabled, dataTestSubj }) => { - const policySteps = [ - { - title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepOneTitle', { - defaultMessage: 'Head over to Ingest Manager.', - }), - children: ( - - - - ), - }, - { - title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepTwoTitle', { - defaultMessage: 'We’ll create a recommended security policy for you.', - }), - children: ( - - - - ), - }, - { - title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepThreeTitle', { - defaultMessage: 'Enroll your agents through Fleet.', - }), - children: ( - - - - ), - }, - ]; + const policySteps = useMemo( + () => [ + { + title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepOneTitle', { + defaultMessage: 'Head over to Ingest Manager.', + }), + children: ( + + + + ), + }, + { + title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepTwoTitle', { + defaultMessage: 'We’ll create a recommended security policy for you.', + }), + children: ( + + + + ), + }, + { + title: i18n.translate('xpack.securitySolution.endpoint.policyList.stepThreeTitle', { + defaultMessage: 'Enroll your agents through Fleet.', + }), + children: ( + + + + ), + }, + ], + [] + ); return (
{loading ? ( - + ) : ( <> diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts index 6245660523974..51b133bf6e146 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts @@ -101,18 +101,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await pageObjects.policy.launchAndFindDeleteModal(); await testSubjects.existOrFail('policyListDeleteModal'); await pageObjects.common.clickConfirmOnModal(); - let emptyPolicyTable; - await retry.waitForWithTimeout( - 'table to not have data and empty state returns', - 2000, - async () => { - emptyPolicyTable = await testSubjects.find('emptyPolicyTable'); - if (emptyPolicyTable) { - return true; - } - return false; - } - ); + const emptyPolicyTable = await testSubjects.find('emptyPolicyTable'); expect(emptyPolicyTable).not.to.be(null); }); }); @@ -157,7 +146,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('and user clicks on page header create button', () => { it('should direct users to the ingest management integrations add datasource', async () => { await pageObjects.policy.navigateToPolicyList(); - await (await pageObjects.policy.findEmptyStateButton()).click(); + await (await pageObjects.policy.findOnboardingStartButton()).click(); await pageObjects.ingestManagerCreateDatasource.ensureOnCreatePageOrFail(); }); }); diff --git a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts index d2bc02aad6bd9..3ffd7eb032c22 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts @@ -105,7 +105,7 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr /** * Finds and returns the onboarding button displayed in empty List pages */ - async findEmptyStateButton() { + async findOnboardingStartButton() { await testSubjects.waitForEnabled('onboardingStartButton'); return await testSubjects.find('onboardingStartButton'); },