title: Jest, Enzyme Test multiple occurrence of the same child component
body: <p>I am trying to test if the content of the mock comes out correctly in my test. Two of it uses a H2Tag component, while the other uses H1Tag Component. I am unable to get the testing right for the H2Tag components, since there is two different strings being tested for. </p>
  
  <p>Is there a way to test multiple occurrence of the same component (with different input props)? Alternatively, is there a better way to achieve this test? </p>
  
  <p>I'm also using Styled Components, so the component name appears slightly different in the debug().</p>
  
  <pre><code>const Partner = ({ content }) =&gt; {
    return (
        &lt;ContentWrapper&gt;
          &lt;H1Tag&gt;{content.headline}&lt;/H1Tag&gt;
          &lt;H4Tag&gt;{content.heading1}&lt;/H4Tag&gt;
          &lt;H1Tag&gt;{content.heading2}&lt;/H1Tag&gt;
        &lt;/ContentWrapper&gt;
    )
  }
  </code></pre>
  
  <pre><code>//Partner.test.js
  import React from 'react'
  import Partner, { H1Tag, H4Tag,} from '../SomePage'
  import { shallow } from 'enzyme'
  
  describe('Partner', function () {
    beforeAll(() =&gt; {
      this.mockContent = {
        headline: 'Partner',
        heading1: 'Hello',
        heading2:
          'ABC XYZ',
      }
    })
  
    beforeEach(() =&gt; {
      this.wrapper = shallow(
        &lt;Partner content={this.mockContent} /&gt;
      )
    })
  
    describe('render', () =&gt; {
      it('shows H1Tags content', () =&gt; {
        const H1TagWrapper = this.wrapper.find(H1Tag)
  
        const { headline, heading2 } = this.mockContent
        // how to test two different elements?
        expect(H1TagWrapper.getElements()).toBe([headline, heading2]) //this fails
      })
  
      it('shows H4Tag content', () =&gt; {
        const H4TagWrapper = this.wrapper.find(H4Tag)
        expect(H4TagWrapper.text()).toEqual(this.mockContent.heading1) //this works
      })
    })
  })
  
  </code></pre>
  
  <p>This is the expected/received results for the current way.</p>
  
  <pre><code>    expect(received).toBe(expected) // Object.is equality
  
      - Expected
      + Received
  
        Array [
      -   "Partner",
      -   "ABC XYZ",
      +   &lt;ForwardRef(PartnerBanner__H1Tag)&gt;
      +     Partner
      +   &lt;/ForwardRef(PartnerBanner__H1Tag)&gt;,
      +   &lt;ForwardRef(PartnerBanner__H1Tag)&gt;
      +     ABC XYZ
      +   &lt;/ForwardRef(PartnerBanner__H1Tag)&gt;,
  </code></pre>