thefrontside / thefrontside/interactors

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

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

material-ui
Dominant language
TypeScript
Stars
36
Forks
2
Avg merge
4m
Merged PRs (30d)
2

Description

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())

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Calendar().setDay(4) action and the renderCalendar reproduction in the issue, focusing on how duplicate days from adjacent months are selected. Confirm the failing assertion, then make the action support the custom day interactor so the September 4 date is selected without the duplicate-day error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
44/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.