title: Jest test is not passing through parameters
body: <p>This is my test component: </p>
  
  <pre><code>import React from "react";
  import Adapter from "enzyme-adapter-react-16";
  import {configure, shallow} from "enzyme";
  import CardEndpoint from "../../../components/cards/CardEndpoint";
  
  configure({adapter: new Adapter()});
  
  describe("&lt;CardEndPoint /&gt;", () =&gt; {
      let wrapper;
  
      beforeAll(() =&gt; {
          wrapper = shallow(&lt;CardEndpoint /&gt;);
      });
  
      it("should add slash in front of an 'slash-less' endpoint", () =&gt; {
          let instance = wrapper.instance();
          let expectedEndpoint = '/house/:houseNumber';
          let testEndpoint = 'house/:houseNumber';
          let slashCheck = instance.checkForBeginSlash(testEndpoint);
          expect(slashCheck).toEqual(expectedEndpoint);
      });
  });
  </code></pre>
  
  <p>Im getting the following error as the parameter '<strong>testEndpoint</strong>' given to 'instance.checkForBegingSlash(<strong>testEndpoint</strong>)' is undefined. </p>
  
  <pre><code> TypeError: Cannot read property 'startsWith' of undefined
  
    11 |         const position = 0;
    12 | 
  &gt; 13 |         if (URI.startsWith(slash)) {
       |                     ^
    14 |             return URI
    15 |         } else {
    16 |             return [URI.slice(0, position), slash, URI.slice(position)].join('');
  </code></pre>
  
  <p>Here's the actual function I'm testing, in which the parameter <strong>URI</strong> is undefined:</p>
  
  <pre><code>checkForBeginSlash = (URI) =&gt; {
      const slash = '/';
      const position = 0;
  
      if (URI.startsWith(slash)) {
          return URI
      } else {
          return [URI.slice(0, position), slash, URI.slice(position)].join('');
      }
  };
  </code></pre>
  
  <p><strong>Any ideas why my test is not passing through the parameter?</strong></p>
  
  <p>My entire CardEndPoint component as requested: </p>
  
  <pre><code>import React from 'react';
  import ListGroup from 'react-bootstrap/ListGroup'
  import Container from 'react-bootstrap/Container'
  import Row from 'react-bootstrap/Row'
  import Col from 'react-bootstrap/Col'
  
  class CardEndpoint extends React.Component {
  
  checkForBeginSlash = (URI) =&gt; {
      const slash = '/';
      const position = 0;
  
      if (URI.startsWith(slash)) {
          return URI
      } else {
          return [URI.slice(0, position), slash, URI.slice(position)].join('');
      }
  };
  
  organizeParams = (params) =&gt; {
      if (params) {
          return Object.values(params).join(', ')
      } else {
          return 'No parameters detected.'
      }
  };
  
  render = () =&gt; {
      return (&lt;React.Fragment&gt;
              &lt;ListGroup.Item className={`card--${this.props.method} no-padding`}&gt;
                  &lt;Container variant="fluid"&gt;
                      &lt;Row&gt;
                          &lt;Col
                              className={`card__method--${this.props.method} d-flex justify-content-center align-items-center`}
                              lg="2" data-testid="createdCardMethod"&gt;
                              {this.props.method}
                          &lt;/Col&gt;
                          &lt;Col className="card__endpoint__url" lg="10" data-testid="createdCardURL"&gt;
                              {this.checkForBeginSlash(this.props.URI)}
                          &lt;/Col&gt;
                      &lt;/Row&gt;
                  &lt;/Container&gt;
              &lt;/ListGroup.Item&gt;
              &lt;ListGroup.Item className={`card--${this.props.method} no-padding`}&gt;
                  &lt;Container variant="fluid"&gt;
                      &lt;Row&gt;
                          &lt;Col&gt;
                              &lt;b&gt;
                                  Query params:
                              &lt;/b&gt;
                              &amp;nbsp; {this.organizeParams(this.props.filteredQueryParams)}
                          &lt;/Col&gt;
                      &lt;/Row&gt;
                      &lt;Row&gt;
                          &lt;Col&gt;
                              &lt;b&gt;
                                  Path params:
                              &lt;/b&gt;
                              &amp;nbsp; {this.organizeParams(this.props.filteredPathParams)}
                          &lt;/Col&gt;
                      &lt;/Row&gt;
                  &lt;/Container&gt;
              &lt;/ListGroup.Item&gt;
          &lt;/React.Fragment&gt;
      );
  };
  }
  
  export default CardEndpoint;
  </code></pre>