"fix" MuteTimings tests

This commit is contained in:
Ashley Harrison
2025-12-12 11:34:28 +00:00
parent f10a494369
commit caff0e2d1e
@@ -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();