0

I'm writing a Cypress test, and want to test a few conditions on our react-dates DayPickerSingleDateController.

I was thinking the clearest way would be to somehow add cy-data attributes to each date element so that I can then script the clicking of various dates etc, but I've not been able to work out from the documentation or source if this is supported in react-dates, and if it is, how to accomplish it.

Perhaps I'm approaching it from the wrong angle!

Thanks

Matt B
  • 176
  • 1
  • 10
  • 1
    When using components like this, I will get an attribute on the base component and execute some sort of `.find()`. – Amit Kahlon Nov 09 '22 at 16:36
  • Ah yes I see @AmitKahlon, thanks. I've realised I can use a combination of find() and the aria-label attribute (which seems to contain the day, date, and whether it's currently selected) to achieve what I need. Thanks again! – Matt B Nov 09 '22 at 20:06

0 Answers0