[next] Fix warnings and errors that appear during test (#2348)

* fix: handle react act errors

* fix: fixed deprecated reporter option
This commit is contained in:
Vinh
2019-06-07 22:01:57 +00:00
committed by Wyatt Johnson
parent d4b99a2a57
commit 5b64d3d14b
17 changed files with 732 additions and 635 deletions
@@ -1,9 +1,9 @@
import { act } from "react-test-renderer";
import sinon from "sinon";
import { pureMerge } from "coral-common/utils";
import { GQLResolver } from "coral-framework/schema";
import {
act,
createResolversStub,
CreateTestRendererParams,
wait,
@@ -134,14 +134,14 @@ it("submits form successfully", async () => {
})
.once();
act(() => {
await act(async () => {
emailField.props.onChange("hans@test.com");
form!.props.onSubmit();
await waitForElement(() =>
within(testRenderer.root).getByText("Check Your Email", { exact: false })
);
});
await waitForElement(() =>
within(testRenderer.root).getByText("Check Your Email", { exact: false })
);
within(testRenderer.root)
.getByText("Close")
.props.onClick();