Developer-DAO / Developer-DAO/academy
PomodoroTimer: Fix tests and potentially refactor component
- Dominant language
- MDX
- Stars
- 111
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
The PomodoroTimer tests were failing.
Discovered during upgrade to NextJS 13 in #189
## Investigation
Essentially the tests were testing the internal implementation -- but when this was wrapped with Popover logic, that broke the tests -- buttons were hidden, and as I discovered, you can have React Testing library grab "hidden" buttons, but then aria-label is ignored.
So I came up with what I thought was the perfect plan --- split the component into two -- one wrapped and one not, which fixed the tests that only had to test internal component.
The only problem is that the business logic is split over the Popover (which displays a changing icon) and the internal implementation -- so needs refactoring.
## TODOs
- [x] fix tests
- [x] refactor to test internal logic and separate out the Popover wrapper
- [ ] refactor to bring back feature to show "status" as an icon in the Popover
- [ ] add GitHub Action to run tests
Contributor guide
Research direction
Locate the PomodoroTimer component, its tests, and the Popover wrapper, then run the existing test suite to reproduce the reported failures. Review how status is represented across the wrapper and internal component; done means the status icon works, tests cover the intended behavior, and a GitHub Action runs them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, nextjs, react
- Domain
- ci-cd, frontend, testing-qa
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100