fix SharedPreferences tests
This commit is contained in:
@@ -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(<SharedPreferences resourceUri="user" preferenceType="user" />);
|
||||
// TODO investigate why we need act
|
||||
// see https://github.com/testing-library/react-testing-library/issues/1375
|
||||
const view = await act(() => render(<SharedPreferences resourceUri="user" preferenceType="user" />));
|
||||
const themeSelect = await screen.findByRole('combobox', { name: 'Interface theme' });
|
||||
await waitFor(() => expect(themeSelect).not.toBeDisabled());
|
||||
return view;
|
||||
|
||||
Reference in New Issue
Block a user