From 9b85acb49e821f16b886c608787b285d813198b6 Mon Sep 17 00:00:00 2001 From: Ashokaditya <1849116+ashokaditya@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:57:05 +0100 Subject: [PATCH] [Security Solution][Endpoint] Fix and unskip flaky test (#149841) > **Note** > **Merge after elastic/kibana/pull/149839** ## Summary Fixes flaky test elastic/kibana/issues/145204 flaky test runners - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1817 x 50 (failed on a single [unrelated ](https://github.com/ashokaditya/kibana/blob/92cb000a2f5116fc7408f52794cea06ad40de4bb/x-pack/test/security_solution_endpoint/apps/endpoint/artifact_entries_list.ts#L75)flaky test) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1826 x 150 (failed on a single run for an [unrelated](https://github.com/ashokaditya/kibana/blob/92cb000a2f5116fc7408f52794cea06ad40de4bb/x-pack/test/security_solution_endpoint/apps/endpoint/artifact_entries_list.ts#L87) flaky test) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1834 x 200 (successful on all runs) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1847 x 100 (successful on all runs) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../management/pages/integration_tests/index.test.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx index 95aed4e29ea3a..d0cbd71e187c5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx @@ -13,7 +13,6 @@ import type { AppContextTestRender } from '../../../common/mock/endpoint'; import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useUserPrivileges } from '../../../common/components/user_privileges'; import { endpointPageHttpMock } from '../endpoint_hosts/mocks'; -import { getUserPrivilegesMockDefaultValue } from '../../../common/components/user_privileges/__mocks__'; jest.mock('../../../common/components/user_privileges'); @@ -30,7 +29,7 @@ describe('when in the Administration tab', () => { }); afterEach(() => { - useUserPrivilegesMock.mockImplementation(getUserPrivilegesMockDefaultValue); + useUserPrivilegesMock.mockReset(); }); describe('when the user has no permissions', () => { @@ -97,8 +96,7 @@ describe('when in the Administration tab', () => { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/145204 - describe.skip('when the user has permissions', () => { + describe('when the user has permissions', () => { it('should display the Management view if user has privileges', async () => { useUserPrivilegesMock.mockReturnValue({ endpointPrivileges: { loading: false, canReadEndpointList: true, canAccessFleet: true },