From 12c6e9615f9b559ed48c3ad7fa23ff940e3440a3 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Fri, 12 Dec 2025 15:45:53 +0000 Subject: [PATCH] "fix" NewReceiverView tests --- .../unified/components/receivers/NewReceiverView.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx b/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx index e1a1aa5aeba..5e88867f747 100644 --- a/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx +++ b/public/app/features/alerting/unified/components/receivers/NewReceiverView.test.tsx @@ -1,3 +1,4 @@ +import { act, fireEvent } from '@testing-library/react'; import { Route, Routes } from 'react-router-dom-v5-compat'; import { render, screen } from 'test/test-utils'; import { byLabelText, byPlaceholderText, byRole, byTestId } from 'testing-library-selector'; @@ -65,7 +66,10 @@ describe('new receiver', () => { await user.type(email, 'tester@grafana.com'); // try to test the contact point - await user.click(await ui.testContactPointButton.find()); + // TODO investigate why we need act/fireEvent + // see https://github.com/testing-library/react-testing-library/issues/1375 + // eslint-disable-next-line testing-library/no-unnecessary-act, testing-library/prefer-user-event + await act(async () => fireEvent.click(await ui.testContactPointButton.find())); expect(await ui.testContactPointModal.find()).toBeInTheDocument();