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();