"fix" MuteTimings tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { act, fireEvent } from '@testing-library/react';
|
||||
import { InitialEntry } from 'history';
|
||||
import { last } from 'lodash';
|
||||
import { Route, Routes } from 'react-router-dom-v5-compat';
|
||||
@@ -144,8 +145,11 @@ const fillOutForm = async ({
|
||||
};
|
||||
|
||||
const saveMuteTiming = async () => {
|
||||
const user = userEvent.setup();
|
||||
await user.click(await screen.findByText(/save time interval/i));
|
||||
// TODO investigate why we need act/fireEvent
|
||||
// see https://github.com/testing-library/react-testing-library/issues/1375
|
||||
const button = await screen.findByText(/save time interval/i);
|
||||
// eslint-disable-next-line testing-library/no-unnecessary-act, testing-library/prefer-user-event
|
||||
await act(() => fireEvent.click(button));
|
||||
};
|
||||
|
||||
setupMswServer();
|
||||
|
||||
Reference in New Issue
Block a user