title: How can I get an aria label from React-Calendar using Cypress
body: <p>I have a test where I need to set the date on a React-Calendar using their date-picker (<a href="https://www.npmjs.com/package/react-calendar" rel="noreferrer">https://www.npmjs.com/package/react-calendar</a>). The only element in the dom that will let me get the date accurately is the aria-label, which includes the full date, e.g., aria-label=&quot;August 12, 2020&quot;. Since the calendar may not include the date in the current view, I need a conditional test that first finds whether or not aria-label=&quot;August 12, 2020&quot; exists in the dom. If not, I need the test to click the next month button and then click the date.</p>
  <p>Here is the code I am working with:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>cy.get('.react-calendar').then(($reactCal) =&gt; {
              if ($reactCal.val().includes(`August 12, 2020`)) {
                  cy.get(`abbr[aria-label="August 12, 2020"]`).click()
              }
              else {
                  cy.get('.react-calendar__navigation__next-button').click()
                  cy.get(`abbr[aria-label="August 12, 2020"]`).click()              
              }
          })</code></pre>
  </div>
  </div>
  </p>