From 83ad168cfe0f5865c4538e0b9bb98173e0c0a07e Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Thu, 14 Jul 2022 09:12:52 +0400 Subject: Wrap Tests In Act Wrap the tests that were raising warnings in act statements. Signed-off-by: Hassan Abouelela --- src/tests/App.test.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/tests/App.test.tsx') diff --git a/src/tests/App.test.tsx b/src/tests/App.test.tsx index 4765f87..9ee1ec7 100644 --- a/src/tests/App.test.tsx +++ b/src/tests/App.test.tsx @@ -1,9 +1,13 @@ import React from "react"; -import { render } from "@testing-library/react"; +import {act, render, waitFor} from "@testing-library/react"; import App from "../App"; -test("renders app to body", () => { - const { container } = render(); - expect(container).toBeInTheDocument(); +test("renders app to body", async () => { + await act(async () => { + const {container} = render(); + await waitFor(() => { + expect(container).toBeInTheDocument(); + }); + }); }); -- cgit v1.2.3