From d06b0b153ead35f9f0f23dc4e0c42157795dc57c Mon Sep 17 00:00:00 2001 From: Kyle Pollich Date: Tue, 29 Oct 2024 13:24:33 -0400 Subject: [PATCH] Run flaky test 1000 times with new query client --- .../package_policy_actions_menu.test.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 7195eb73890f2..161c7a1888fdd 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 @@ -115,13 +115,15 @@ describe('PackagePolicyActionsMenu', () => { }); it('Should disable upgrade button if package does not have upgrade', async () => { - const agentPolicies = createMockAgentPolicies(); - const packagePolicy = createMockPackagePolicy({ hasUpgrade: false }); - const { utils } = renderMenu({ agentPolicies, packagePolicy }); - await act(async () => { - const upgradeButton = utils.getByTestId('PackagePolicyActionsUpgradeItem'); - expect(upgradeButton).toBeDisabled(); - }); + for (let i = 0; i < 1000; i++) { + const agentPolicies = createMockAgentPolicies(); + const packagePolicy = createMockPackagePolicy({ hasUpgrade: false }); + const { utils } = renderMenu({ agentPolicies, packagePolicy }); + await act(async () => { + const upgradeButton = utils.getByTestId('PackagePolicyActionsUpgradeItem'); + expect(upgradeButton).toBeDisabled(); + }); + } }); it('Should enable upgrade button if package has upgrade', async () => {