Hello everyone,
I used React to build the Pomodoro clock. I can’t figure out what’s wrong, but running the tests gives different results depending on the number I use for the setInterval. It actually passes all tests if the interval is set to 10, or 20. Fails user story 21 (If the timer is paused and I click the element with id="start_stop"
, the countdown should resume running from the point at which it was paused.) when the interval is at 30 or 40. Fails User Story #25 (When a break countdown reaches zero (NOTE: timer MUST reach 00:00), a new session countdown should begin, counting down from the value currently displayed in the id="session-length"
element.) when interval is at 50. And fails several tests if interval is set at 1000 (1 second) because the timer, the test claims does not reach 00:00 even though it does when I see it working. Perhaps my entire approach is wrong. Any help would be appreciated.
Link to my CodePen: https://codepen.io/raphaeluziel/pen/qQGXyd?editors=0010