diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx index 55e2446241da2..63a3a93b7e894 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx @@ -18,12 +18,12 @@ function renderMenu({ agentPolicy, packagePolicy, showAddAgent = false, - isOpen = true, + defaultIsOpen = true, }: { agentPolicy: AgentPolicy; packagePolicy: InMemoryPackagePolicy; showAddAgent?: boolean; - isOpen?: boolean; + defaultIsOpen?: boolean; }) { const renderer = createIntegrationsTestRendererMock(); @@ -33,7 +33,7 @@ function renderMenu({ packagePolicy={packagePolicy} showAddAgent={showAddAgent} upgradePackagePolicyHref="" - isOpen={isOpen} + defaultIsOpen={defaultIsOpen} key="test1" /> ); @@ -87,17 +87,17 @@ test('Should disable upgrade button if package does not have upgrade', async () const packagePolicy = createMockPackagePolicy({ hasUpgrade: false }); const { utils } = renderMenu({ agentPolicy, packagePolicy }); await act(async () => { - const upgradeButton = utils.getByText('Upgrade package policy').closest('button'); + const upgradeButton = utils.getByText('Upgrade integration policy').closest('button'); expect(upgradeButton).toBeDisabled(); }); }); -test('Should enable upgrade button if package does has upgrade', async () => { +test('Should enable upgrade button if package has upgrade', async () => { const agentPolicy = createMockAgentPolicy(); const packagePolicy = createMockPackagePolicy({ hasUpgrade: true }); const { utils } = renderMenu({ agentPolicy, packagePolicy }); await act(async () => { - const upgradeButton = utils.getByText('Upgrade package policy').closest('button'); + const upgradeButton = utils.getByText('Upgrade integration policy').closest('button'); expect(upgradeButton).not.toBeDisabled(); }); }); diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx index 165f01361edaf..eefa3c870f283 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx @@ -24,7 +24,7 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ packagePolicy: InMemoryPackagePolicy; viewDataStep?: EuiStepProps; showAddAgent?: boolean; - isOpen?: boolean; + defaultIsOpen?: boolean; upgradePackagePolicyHref: string; }> = ({ agentPolicy, @@ -32,13 +32,13 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ viewDataStep, showAddAgent, upgradePackagePolicyHref, - isOpen = false, + defaultIsOpen = false, }) => { const [isEnrollmentFlyoutOpen, setIsEnrollmentFlyoutOpen] = useState(false); const { getHref } = useLink(); const hasWriteCapabilities = useCapabilities().write; const refreshAgentPolicy = useAgentPolicyRefresh(); - const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(isOpen); + const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(defaultIsOpen); const onEnrollmentFlyoutClose = useMemo(() => { return () => setIsEnrollmentFlyoutOpen(false);