title: Testing styled-components when referencing to other component
body: <p>I am having an issue trying to test a component made with styled-components. </p>
  
  <p>so i have two components and i am trying to get the second component's background color to change if i hover on the first element.</p>
  
  <p>My components:</p>
  
  <pre><code>const Container = styled.div``
  
  const Label = styled.label`
       ${Container}:hover &amp; {
              background-color: red;
       }
  `
  </code></pre>
  
  <p>Whenever i try to test the label component with jest <code>expect(label).toHaveStyle()</code> it always throws an error that said  <code>TypeError: Cannot read property 'parentElement' of null</code>. But when i commented the reference to container component within label the test passes. Can anybody help? Thank you sooo much.</p>
  
  <p>I am using react-testing-library to render my components in my test files.</p>