title: How do you check the equality of the inner text of a element using cypress?
body: <p>I have a div that has another div inside of it and I want to check the equality of the inner text of the div. I have figured out how to do it using the <code>invoke('text')</code> function, but i am wondering if that is the best way. So my question is: how do you check the equality of the inner text of a element using cypress?</p>
  
  <pre class="lang-js prettyprint-override"><code>it('the channel name should contain be Anakin Skywaler', () =&gt; {
    //This works but can we be more specific with our selector
    cy.get(&quot;[data-test-id='Skywalker,Anakin']&quot;).should('contain', 'Skywalker,Anakin');
  })
  
  it('the channel name should equal Skywalker,Anakin', () =&gt; {
    cy.get(&quot;[data-test-id='Skywalker,Anakin']&quot;).find('.channel-name').invoke('text').then((text) =&gt; {
      expect(text.trim()).equal('Skywalker,Anakin')
    });
  });
  </code></pre>
  <p>Please ignore the Star War Reference!</p>