title: Jest / Enzyme - Cannot read property 'value' of undefined
body: <p>I have a component I am trying to test. It looks like so -</p>
  
  <pre><code>import * as React from 'react';
  import { CATEGORY_TYPES } from '../../constants';
  
  import './ResultCard.sass';
  
  const ResultCard = ({ result, onSelectResult = null }) =&gt; {
    const { guid, category, postcode, condition } = result;
    const { value, image } = CATEGORY_TYPES.find(asset =&gt; asset.type === result.category);
  
    return (
      &lt;article className="media result-card is-marginless" onClick={() =&gt; onSelectResult()}&gt;
     &lt;!-- omitted for brevity --&gt;
      &lt;/article&gt;
    );
  };
  
  export default ResultCard;
  </code></pre>
  
  <p>This is tested as such using the follow test case -</p>
  
  <pre><code>import * as React from 'react';
  import { shallow } from 'enzyme';
  
  import { ResultCard } from '../../../src/components';
  import { CATEGORY_TYPES } from '../../../src/constants';
  
  describe('.ResultCard', () =&gt; {
    it('should render', () =&gt; {
      const { wrapper } = setup({});
  
      expect(wrapper.exists()).toBe(true);
    });
  });
  
  const setup = propOverrides =&gt; {
    const props = Object.assign(
      { result: { guid: '61934c1f-ce55-5cc7-e1d7-18b391fe7944', postcode: 'ab12 3cd', category: 'foo', condition: 'bar' } },
      propOverrides
    );
    const wrapper = shallow(&lt;ResultCard {...props} /&gt;);
    return { wrapper };
  };
  </code></pre>
  
  <p>However I am getting the following error from my test runner -</p>
  
  <pre><code>  TypeError: Cannot read property 'value' of undefined
  
         7 |   const { guid, category, postcode, condition } = result;
         8 |   const { value, image } = CATEGORY_TYPES.find(asset =&gt; asset.type === result.category);
      &gt;  9 |
        10 |   return (
        11 |     &lt;article className="media result-card is-marginless" onClick={() =&gt; onSelectResult()}&gt;
        12 |       &lt;figure className="media-left"&gt;
  </code></pre>
  
  <p>I am unsure how I can introduce the component logic around CATEGORY_TYPES into my component.</p>