From fe1bfe5de3589802a482402da42f5a0fdc3b3344 Mon Sep 17 00:00:00 2001 From: Eyo Okon Eyo Date: Wed, 11 Dec 2024 12:26:24 +0100 Subject: [PATCH] remove unnecesssary async helpers --- .../edit_package_policy_page/index.test.tsx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx index 21edd002c7ff7..8ddc2e80b0aa8 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx @@ -293,8 +293,6 @@ describe('edit package policy page', () => { fireEvent.click(renderResult.getByText('Change defaults')); - await waitFor(() => Promise.resolve(null)); - fireEvent.change(renderResult.getByDisplayValue('/var/log/nginx/access.log*'), { target: { value: '' }, }); @@ -320,8 +318,6 @@ describe('edit package policy page', () => { fireEvent.click(renderResult.getByRole('switch')); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); await waitFor(() => { @@ -356,8 +352,6 @@ describe('edit package policy page', () => { }); fireEvent.click(renderResult.getByRole('switch')); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); await waitFor(() => { @@ -384,8 +378,6 @@ describe('edit package policy page', () => { fireEvent.click(renderResult.getByRole('switch')); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); await waitFor(() => { @@ -515,8 +507,6 @@ describe('edit package policy page', () => { fireEvent.click(renderResult.getByRole('switch')); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); await waitFor(() => expect(sendUpdatePackagePolicy).toHaveBeenCalled()); @@ -557,12 +547,8 @@ describe('edit package policy page', () => { fireEvent.click(renderResult.getByTestId('createNewAgentPolicyButton')); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getByText(/Save integration/).closest('button')!); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getAllByText(/Save and deploy changes/)[1].closest('button')!); await waitFor(() => { @@ -628,8 +614,6 @@ describe('edit package policy page', () => { fireEvent.click(renderResult.getByText(/Save integration/).closest('button')!); - await waitFor(() => Promise.resolve(null)); - fireEvent.click(renderResult.getAllByText(/Save and deploy changes/)[1].closest('button')!); await waitFor(() =>