title: TypeError: Cannot read property 'title' of undefined in ReactJS Jest Test
body: <p>This is my code for Entry.js</p>
  
  <pre><code>import React, { useState } from "react";
  import EdiText from "react-editext";
  
  export default function Entry({ entry, index, removeEntry }) {
    //eslint-disable-next-line
    const [value, setValue] = useState();
  
    const handleSave = value =&gt; {
      console.log(value);
      setValue(value);
    };
    const data = entry.title;
  
    return (
      &lt;div className="entry" style={{ width: "50%" }}&gt;
        &lt;button
          className="deleteBttn"
          style={{ background: "red", float: "right" }}
          onClick={() =&gt; removeEntry(index)}
        &gt;
          x
        &lt;/button&gt;
        &lt;EdiText
          className="editText"
          value={data}
          type="text"
          onSave={handleSave}
          buttonsAlign="before"
        /&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>
  
  <p>This is the Entry.test.js. I want to check if the Entry component renders correctly.</p>
  
  <pre><code>import React from "react";
  import Enzyme, { mount, shallow } from "enzyme";
  import Adapter from "enzyme-adapter-react-16";
  import ReactDOM from "react-dom";
  
  import Entry from "../../components/Entry";
  
  describe("Entry Component", () =&gt; {
    beforeAll(() =&gt; {
      Enzyme.configure({ adapter: new Adapter() });
    });
  
    it("renders correctly", () =&gt; {
      shallow(&lt;Entry data={"entry sample"} /&gt;);
      const div = document.createElement("div");
      ReactDOM.render(&lt;Entry /&gt;, div);
    });
  });
  </code></pre>
  
  <p>When I run the test it returns an error of
   TypeError: Cannot read property 'title' of undefined</p>
  
  <pre><code>  10 |     setValue(value);
    11 |   };
  &gt; 12 |   const data = entry.title;
  </code></pre>
  
  <p>What am I doing wrong?</p>