title: How to check that element has either of classes in Cypress?
body: <p>We search for an invalid element as following:</p>
  
  <pre class="lang-js prettyprint-override"><code>const invalidClasses = '.invalid, .invalid-default';
  
  getInvalidElement() {
      cy.get(invalidClasses)
  };
  </code></pre>
  
  <p>Now I have another function which accepts the element and checks if it has the invalid classes:</p>
  
  <pre class="lang-js prettyprint-override"><code>isInvalid(selector) {
   return cy.get(selector).should('have.class','invalid');
  }
  </code></pre>
  
  <p>How can I check that the element has any of the two classes?</p>
  
  <p>I know I can do</p>
  
  <p><code>cy.get(selector).invoke('attr','class').should('match','/invalid/');</code></p>
  
  <p>But what if the classes were different? </p>
  
  <p>(Also the conditional testing does not apply to this case, there is no logic whether it's the first of the classes or the second one, we just want more abstract class for reusing) </p>