diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx index 09e8a7c90750e..a64425d28ae04 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx @@ -18,6 +18,7 @@ import type { GetPackagePoliciesResponse, GetStatsResponse, GetSettingsResponse, + GetVerificationKeyIdResponse, } from '../../../../../../../common/types/rest_spec'; import type { DetailViewPanelName, @@ -39,8 +40,7 @@ import { ExperimentalFeaturesService } from '../../../../services'; ExperimentalFeaturesService.init({}); import { Detail } from '.'; -// FLAKY: https://github.com/elastic/kibana/issues/150607 -describe.skip('when on integration detail', () => { +describe('when on integration detail', () => { const pkgkey = 'nginx-0.3.7'; const detailPageUrlPath = pagePathGetters.integration_details_overview({ pkgkey })[1]; let testRenderer: TestRenderer; @@ -138,6 +138,16 @@ describe.skip('when on integration detail', () => { await render(); }); + it('should NOT display agent policy usage count', async () => { + await mockedApi.waitForApi(); + expect(renderResult.queryByTestId('agentPolicyCount')).toBeNull(); + }); + + it('should NOT display the Policies tab', async () => { + await mockedApi.waitForApi(); + expect(renderResult.queryByTestId('tab-policies')).toBeNull(); + }); + it('should display version text and no callout if prerelease setting disabled', async () => { await mockedApi.waitForApi(); expect((renderResult.queryByTestId('versionText') as any)?.textContent).toEqual('1.0.0'); @@ -324,6 +334,7 @@ interface EpmPackageDetailsResponseProvidersMock { agentPolicyList: jest.MockedFunction<() => GetAgentPoliciesResponse>; appCheckPermissions: jest.MockedFunction<() => CheckPermissionsResponse>; getSettings: jest.MockedFunction<() => GetSettingsResponse>; + getVerificationKeyId: jest.MockedFunction<() => GetVerificationKeyIdResponse>; } const mockApiCalls = ( @@ -805,6 +816,8 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos const getSettingsResponse = { item: { prerelease_integrations_enabled: true } }; + const getVerificationKeyIdResponse = { id: 'test-verification-key' }; + const mockedApiInterface: MockedApi = { waitForApi() { return new Promise((resolve) => { @@ -824,6 +837,7 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos agentPolicyList: jest.fn().mockReturnValue(agentPoliciesResponse), appCheckPermissions: jest.fn().mockReturnValue(appCheckPermissionsResponse), getSettings: jest.fn().mockReturnValue(getSettingsResponse), + getVerificationKeyId: jest.fn().mockReturnValue(getVerificationKeyIdResponse), }, }; @@ -880,6 +894,9 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos if (path === '/api/fleet/settings') { return mockedApiInterface.responseProvider.getSettings(); } + if (path === '/api/fleet/epm/verification_key_id') { + return mockedApiInterface.responseProvider.getVerificationKeyId(); + } const err = new Error(`API [GET ${path}] is not MOCKED!`); // eslint-disable-next-line no-console