Skip to content

Commit

Permalink
Run flaky test 1000 times with new query client
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Oct 29, 2024
1 parent c7b8ca0 commit d06b0b1
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit d06b0b1

Please sign in to comment.