title: Why are material UI components not rendered in jsdom when using Jest?
body: <p>I am using Jest/React Testing Library to test the UI.</p>
  <p>I have a component whose return statement looks like this:</p>
  <pre><code>const sidebarContentUp = (
      &lt;Drawer
        anchor=&quot;left&quot;
        onClose={onMobileClose}
        open={openMobile}
        PaperProps={{
          sx: {
            backgroundColor: 'background.paper',
            width: 280,
          },
        }}
        variant=&quot;temporary&quot;
        data-testid=&quot;drawer-up&quot;
      &gt;
        {content}
      &lt;/Drawer&gt;
    );
  
    const sidebarContentDown = (
      &lt;Drawer
        anchor=&quot;left&quot;
        open
        PaperProps={{
          sx: {
            backgroundColor: 'background.paper',
            height: 'calc(100% - 64px) !important',
            top: '64px !Important',
            width: 280,
          },
        }}
        variant=&quot;persistent&quot;
      &gt;
        {content}
      &lt;/Drawer&gt;
    );
  
    return (
      &lt;&gt;
        {process.env.NEXT_PUBLIC_IS_TESTING ? (
          &lt;Grid&gt;
            &lt;div&gt;div2&lt;/div&gt;
            {sidebarContentUp}
            {/* {sidebarContentDown} */}
            &lt;div&gt;div3&lt;/div&gt;
          &lt;/Grid&gt;
        ) : (
          &lt;&gt;
            &lt;Hidden lgUp&gt;{sidebarContentUp}&lt;/Hidden&gt;
            &lt;Hidden lgDown&gt;{sidebarContentDown}&lt;/Hidden&gt;
          &lt;/&gt;
        )}
      &lt;/&gt;
    );
  };
  </code></pre>
  <p>There are no hidden attributes or anything for <code>sidebarContentUp</code>, but it is never rendered in the jsdom when running tests.</p>
  <p>I only see div2 and div3</p>
  <p>I could not figure out for days.</p>
  <p>Why is it not rendered, and how can I fix this?</p>
  <p>Another issue that might give more hints is that when I don't have <code>{sidebarContentDown}</code> commented out, it throws an error</p>
  <pre><code> Error: Uncaught [TypeError: Cannot read property 'includes' of undefined]
  </code></pre>