title: Check if element has href if it does it shouldn't be empty Cypress.io
body: <p>Tring to do an if statement in cypress that finds all a tag's on the page and if they have a href then it shouldn't be empty.</p>
  
  <p>This is what I've got so far: </p>
  
  <pre><code>cy.get("a").each($el =&gt; {
      cy.wrap($el)
       .should("have.attr", "href")
       .and("include", "/");
  });
  </code></pre>
  
  <p>However this checks everything even if it doesn't have a href.</p>