showing results for - "how to test useeffect with enzyme"
Magdalena
01 Jul 2019
1import React from "react";
2import { render, unmountComponentAtNode } from "react-dom";
3import { act } from "react-dom/test-utils";
4
5import Contact from "./contact";
6import MockedMap from "./map";
7
8jest.mock("./map", () => {
9  return function DummyMap(props) {
10    return (
11      <p>A dummy map.</p>
12    );
13  };
14});
15
16it("should render contact information", () => {
17  const center = { lat: 0, long: 0 };
18  act(() => {
19    render(
20      <Contact
21        name="Joni Baez"
22        email="test@example.com"
23        site="http://test.com"
24        center={center}
25      />,
26      container
27    );
28  });
29});
30