title: Jest test fails because it doesn't recognise a props value
body: <p>Having this React function, tried to run a test but it doesn't pass it:</p>
  <pre><code>import React, { useEffect } from 'react';
  import { useDispatch, useSelector, shallowEqual } from 'react-redux';
  import { useIntl } from 'react-intl';
  import {
    PrimaryButton,
    OutlineButton
  } from 'react-komodo-design';
  
  const Buttons = () =&gt; {
    const dispatch = useDispatch();
    const intl = useIntl();
  
    const orderType = useSelector(
      (state) =&gt; state.orderDetails.orderDetails.orderType,
      shallowEqual
    );
  
   ...
  
    return (
      &lt;div&gt;
        &lt;OutlineButton&gt;
          {intl.formatMessage({ id: 'buttons' })}
        &lt;/OutlineButton&gt;
        {orderType.toLowerCase() !== 't9' &amp;&amp; (
          &lt;PrimaryButton
            onClick={clickReorder}
          &lt;/PrimaryButton&gt;
        )}
      &lt;/div&gt;
    );
  };
  
  export default Buttons;
  </code></pre>
  <p>The test file is this:</p>
  <pre><code>import React from 'react';
  import { render } from '@testing-library/react';
  import Buttons from './Buttons';
  import { WrapIntlProvider, WrapStore } from '../../testsHelper';
  
  describe('&lt;Buttons /&gt;', function () {
    it('should render &lt;Buttons&gt;&lt;/Buttons&gt;', () =&gt; {
      const { container } = render(
        &lt;WrapStore&gt;
          &lt;WrapIntlProvider&gt;
            &lt;Buttons /&gt;
          &lt;/WrapIntlProvider&gt;
        &lt;/WrapStore&gt;
      );
      expect(container).toMatchSnapshot();
    });
  });
  </code></pre>
  <p>Error message: <strong>TypeError: Cannot read property 'toLowerCase' of undefined</strong></p>
  <p>What can be done to avoid this error?</p>
  <p>I've tried to add values inside the test function like this:</p>
  <p><code>&lt;Buttons orderType=&quot;test&quot; /&gt;</code> or <code>&lt;Buttons orderType={&quot;test'} /&gt;</code> or send it as a variable:</p>
  <pre><code>describe('&lt;Buttons /&gt;', function () {
    it('should render &lt;Buttons&gt;&lt;/Buttons&gt;', () =&gt; {
      const xx = &quot;test&quot;; // &lt;--- added here
      const { container } = render(
        &lt;WrapStore&gt;
          &lt;WrapIntlProvider&gt;
            &lt;Buttons orderType={xx} /&gt;
          &lt;/WrapIntlProvider&gt;
        &lt;/WrapStore&gt;
      );
      expect(container).toMatchSnapshot();
    });
  });
  </code></pre>