diff --git a/public/app/core/components/SharedPreferences/SharedPreferences.test.tsx b/public/app/core/components/SharedPreferences/SharedPreferences.test.tsx index d3e4baa1f4d..699e39a34ef 100644 --- a/public/app/core/components/SharedPreferences/SharedPreferences.test.tsx +++ b/public/app/core/components/SharedPreferences/SharedPreferences.test.tsx @@ -1,3 +1,4 @@ +import { act } from '@testing-library/react'; import { comboboxTestSetup } from 'test/helpers/comboboxTestSetup'; import { getSelectParent, selectOptionInTest } from 'test/helpers/selectOptionInTest'; import { render, screen, userEvent, waitFor, within } from 'test/test-utils'; @@ -29,7 +30,9 @@ const selectComboboxOptionInTest = async (input: HTMLElement, optionOrOptions: s }; const setup = async () => { - const view = render(); + // TODO investigate why we need act + // see https://github.com/testing-library/react-testing-library/issues/1375 + const view = await act(() => render()); const themeSelect = await screen.findByRole('combobox', { name: 'Interface theme' }); await waitFor(() => expect(themeSelect).not.toBeDisabled()); return view;