"fix" NewReceiverView tests

This commit is contained in:
Ashley Harrison
2025-12-12 15:45:53 +00:00
parent 7a0d7c5dec
commit 12c6e9615f
@@ -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();