title: Jest, Enzyme test failing on window variable undefined
body: <p>I'm trying to create a window object to pass to my tests that includes a window variable. The test looks like:</p>
  
  <pre><code>const baseProps = {};
  
  Enzyme.configure({ adapter: new Adapter() });
  
  const baseWrapper = shallow(
    &lt;DivisionOrderIndex {...baseProps} /&gt;,
  );
  
  describe('&lt;DivisionOrderIndex /&gt;', () =&gt; {
    test('renders the MsDataGridServer', () =&gt; {
      expect(baseWrapper.find(MsDataGridBulkDelete))
        .toHaveLength(1);
    });
  </code></pre>
  
  <p>The error message I receive is:</p>
  
  <pre><code>TypeError: Cannot read property 'read_only' of undefined
  
        300 |             &lt;/TitleButton&gt;
        301 |           &lt;/div&gt;
      &gt; 302 |           {!window.jsdata.read_only &amp;&amp; (
            |                           ^
        303 |             &lt;div id="page-buttons"&gt;
        304 |               &lt;a href="/division_order_create" className="btn btn-primary"&gt;Create New&lt;/a&gt;
        305 |             &lt;/div&gt;
  </code></pre>
  
  <p>I've tried adding that data to my window object like so:</p>
  
  <pre><code>describe('&lt;DivisionOrderIndex /&gt;', () =&gt; {
    Object.defineProperty(window, 'jsdata', {
        read_only: false,
      });
    test('renders the MsDataGridServer', () =&gt; {
      expect(baseWrapper.find(MsDataGridBulkDelete))
        .toHaveLength(1);
    });
  </code></pre>
  
  <p>But I continue to get the same error. Is this the correct way to pass both the window object or the variables? Any input would be appreciated. </p>