title: "Cannot read property includes of undefined" error in Jest and Enzyme
body: <p>I have a React component which is used to render Checkbox. The component code has a function which looks like this:</p>
  
  <pre><code>const generateCheckboxes = (array, filterType) =&gt; {
          return array.map((filter, i) =&gt; {
              if (!isNullOrUndefined(filter) &amp;&amp; filter !== "") {
                  const applied = props.appliedFilterList[filterType].includes(filter);
                  console.log("yes", props.appliedFilterList[filterType]);
                  return (
                      &lt;Row key={i} noLine={i === 0}&gt;
                          &lt;Checkbox checked={applied} onClick={() =&gt; props.toggleFilter(filterType, filter)}&gt;
                              {filter}
                          &lt;/Checkbox&gt;
                      &lt;/Row&gt;
                  );
              }
              return false;
          });
      };
  </code></pre>
  
  <p>The render function looks like this:</p>
  
  <pre><code>return (
          &lt;div&gt;
              &lt;div&gt;Access&lt;/div&gt;
                  {generateCheckboxes(props.accessFilters, "access")}
  
              &lt;div&gt;Bandwidth&lt;/div&gt;
                  {generateCheckboxes(props.bandwidthFilters, "bandwidth")}
          &lt;/div&gt;   
      );
  </code></pre>
  
  <p>Now I am trying to write a test for this component where i am just passing the component alongwith the props in shallow menthod of Enzyme.I just want to check if the component is rendered properly by passing some mock data in the test case. The test looks like :</p>
  
  <pre><code>import React from "react";
  import { mount, shallow } from "enzyme";
  import Checkbox from "../../lib/Checkbox";
  import FilterDropdownContent, { Header } from "../components/FilterDropdownContent";
  import { generateCheckboxes } from "../components/FilterDropdownContent";
  import { access } from "fs";
  
  const accessData = ["Access Type Of The Service"];
  const bandwidthData = ["the allowed band width", "the allowed band width"];
  const termsFiltersData = ["term associated with the service"];
  const appliedFilters = [
      {
          access: ["Access Type Of The Service"],
          bandwidth: ["the allowed band width", "the allowed band width"],
          term: ["term associated with the service"]
      }
  ];
  
  describe("test the FilterDropdown component", () =&gt; {
      it("renders correctly", () =&gt; {
          const wrapper = mount(
              &lt;FilterDropdownContent
                  accessFilters={accessData}
                  bandwidthFilters={bandwidthData}
                  appliedFilterList={appliedFilters}
                  termsFilters={termsFiltersData}
                  toggleFilter={false}
              /&gt;
          );
      });
  });
  </code></pre>
  
  <p>But my test fails with the error :
     <strong>TypeError: Cannot read property 'includes' of undefined</strong></p>
  
  <p>The includes property is in the generateCheckboxes( ) function.I have passed the required props in the test case.But I am not sure what is causing the issue.Can someone please help me with this?</p>