From 4c90d1028146b4627008f9f4d9d60716f48539dc Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Wed, 10 Dec 2025 10:24:32 +0000 Subject: [PATCH] fix AnnotationsStep changes --- .../rule-editor/AnnotationsStep.test.tsx | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.test.tsx b/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.test.tsx index 5fb3267432a..4ff8fc6411a 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.test.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AnnotationsStep.test.tsx @@ -1,3 +1,4 @@ +import { act } from '@testing-library/react'; import type { JSX } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { render, screen, within } from 'test/test-utils'; @@ -301,15 +302,20 @@ describe('AnnotationsField', function () { }) ); - render( - + // TODO investigate why we need act + // see https://github.com/testing-library/react-testing-library/issues/1375 + // eslint-disable-next-line testing-library/no-unnecessary-act + await act(() => + render( + + ) ); expect(await ui.dashboardAnnotation.find()).toBeInTheDocument();