diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx index 356d44a8105287..71b6732491b5dd 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx @@ -15,8 +15,10 @@ import React from 'react'; import { act } from '@testing-library/react'; import { endpointPageHttpMock } from '../../../mocks'; import { fireEvent } from '@testing-library/dom'; +import { licenseService } from '../../../../../../common/hooks/use_license'; jest.mock('../../../../../../common/lib/kibana'); +jest.mock('../../../../../../common/hooks/use_license'); describe('When using the Endpoint Details Actions Menu', () => { let render: () => Promise>; @@ -112,4 +114,21 @@ describe('When using the Endpoint Details Actions Menu', () => { expect(coreStart.application.navigateToApp).toHaveBeenCalled(); }); }); + + describe('and license is NOT PlatinumPlus', () => { + (licenseService as jest.Mocked).isPlatinumPlus.mockReturnValue(false); + + it('should not show the `isoalte` action', async () => { + setEndpointMetadataResponse(); + await render(); + expect(renderResult.queryByTestId('isolateLink')).toBeNull(); + }); + + it('should still show `unisolate` action for endpoints that are currently isolated', async () => { + setEndpointMetadataResponse(true); + await render(); + expect(renderResult.queryByTestId('isolateLink')).toBeNull(); + expect(renderResult.getByTestId('unIsolateLink')).not.toBeNull(); + }); + }); });