"fix" NewReceiverView tests
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user