aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/App.test.tsx
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-07-14 09:12:52 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-07-14 09:12:52 +0400
commit83ad168cfe0f5865c4538e0b9bb98173e0c0a07e (patch)
tree6ec8abaa2b055913f25ab2525ca6513d3897a8a6 /src/tests/App.test.tsx
parentBump @swc/core from 1.2.204 to 1.2.213 (diff)
Wrap Tests In Act
Wrap the tests that were raising warnings in act statements. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'src/tests/App.test.tsx')
-rw-r--r--src/tests/App.test.tsx12
1 files changed, 8 insertions, 4 deletions
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(<App />);
- expect(container).toBeInTheDocument();
+test("renders app to body", async () => {
+ await act(async () => {
+ const {container} = render(<App/>);
+ await waitFor(() => {
+ expect(container).toBeInTheDocument();
+ });
+ });
});