diff --git a/src/testing/utils.tsx b/src/testing/utils.tsx index f51eafe593f..9746985ef68 100644 --- a/src/testing/utils.tsx +++ b/src/testing/utils.tsx @@ -297,8 +297,9 @@ export const expectTooltipOnHover = async ( await userEvent.hover(element.querySelector("i")!); } - const pass = - screen.getAllByRole("tooltip", { name: tooltipText }).length === 1; + const pass = await vi.waitFor( + () => screen.getAllByRole("tooltip", { name: tooltipText }).length === 1 + ); if (pass) { return { @@ -325,5 +326,14 @@ export const renderHookWithMockStore = (hook: Hook) => { return renderHook(hook, { wrapper: generateWrapper() }); }; -export * from "@testing-library/react"; +export const waitFor = vi.waitFor; +export { + act, + cleanup, + fireEvent, + screen, + render, + renderHook, + within, +} from "@testing-library/react"; export { default as userEvent } from "@testing-library/user-event";