From 25e99e95e80b21c474256ed5f686fa2b156ed5a2 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 10 Sep 2026 12:26:36 +0200 Subject: [PATCH] Use fireEvent for flyout close-button click to fix Jest timeout Co-Authored-By: Claude Opus 4 (1M context) --- .../shared/edit_on_the_fly/flyout_wrapper.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/flyout_wrapper.test.tsx b/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/flyout_wrapper.test.tsx index 0d3bd543b5c7d..66da4a7b97915 100644 --- a/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/flyout_wrapper.test.tsx +++ b/x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/flyout_wrapper.test.tsx @@ -6,8 +6,7 @@ */ import React from 'react'; -import { screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; +import { fireEvent, screen } from '@testing-library/react'; import { renderWithReduxStore } from '../../../mocks'; import { FlyoutWrapper } from './flyout_wrapper'; import type { FlyoutWrapperProps } from './types'; @@ -89,7 +88,7 @@ describe('Flyout wrapper', () => { it('should call onCancel when the header close button is clicked', async () => { const { onCancel } = mountFlyoutWrapper(); - await userEvent.click(screen.getByTestId('euiFlyoutCloseButton')); + fireEvent.click(screen.getByTestId('euiFlyoutCloseButton')); expect(onCancel).toHaveBeenCalledTimes(1); });