interactors icon indicating copy to clipboard operation
interactors copied to clipboard

Allow pass a custom third-party interactor to `setDay` action for Calendar

Open wKich opened this issue 4 years ago • 0 comments

There is a case with custom day render there days from prev and next months could be visible. In that situation setDay with number of the day throws an error because calendar container contains two same days.

test.step(
  renderCalendar((onChange) => ({
    renderDay: (day, _selectedDate, dayInCurrentMonth, dayComponent) =>
      cloneElement(dayComponent, {
        hidden: false,
        ...(dayInCurrentMonth
          ? undefined
          : { style: { opacity: "0.5" }, onClick: () => onChange?.(day as Date) }),
      }),
  }))
)
.step(Calendar().setDay(4))
.assertion(Calendar("4 September 2014").exists())

wKich avatar Apr 20 '21 04:04 wKich