Pomodoro Clock Project will not pass the tests

Project link: Pomodoro Clock

Although I think the app is working as intended. It still won’t pass the tests.

Here are the failed tests:

  • I can see an element with corresponding id=“time-left”. NOTE: Paused or running, the value in this field should always be displayed in mm:ss format (i.e. 25:00).

  • When I click the element with the id of “reset”, any running timer should be stopped, the value within id=“break-length” should return to 5, the value within id=“session-length” should return to 25, and the element with id=“time-left” should reset to it’s default state.

  • When I first click the element with id=“start_stop”, the timer should begin running from the value currently displayed in id=“session-length”, even if the value has been incremented or decremented from the original value of 25.

  • If the timer is running, the element with the id of “time-left” should display the remaining time in mm:ss format (decrementing by a value of 1 and updating the display every 1000ms).

  • If the timer is running and I click the element with id=“start_stop”, the countdown should pause.

  • 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 a session countdown reaches zero (NOTE: timer MUST reach 00:00), and a new countdown begins, the element with the id of “timer-label” should display a string indicating a break has begun.

  • When a session countdown reaches zero (NOTE: timer MUST reach 00:00), a new break countdown should begin, counting down from the value currently displayed in the id=“break-length” element.

  • When a break countdown reaches zero (NOTE: timer MUST reach 00:00), and a new countdown begins, the element with the id of “timer-label” should display a string indicating a session has begun.

  • 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 a countdown reaches zero (NOTE: timer MUST reach 00:00), a sound indicating that time is up should play. This should utilize an HTML5 tag and have a corresponding id=“beep”.

  • The audio element with id of “beep” must stop playing and be rewound to the beginning when the element with the id of “reset” is clicked.


Just for the first error itself here’s my code:

export default ({ children }) => (
  <div id="time-left" className="timer-wrapper">
    {children}
  </div>
);
<Timer>{this.timerDisplay()}</Timer>

I think it works just fine, but will not pass the test. What am I doing wrong?

Hello!

You have the same problem I had: when your counter reaches 0, it changes to whatever the break length is instead of waiting for a second to change back.

For example, if the session length = 1 and break length = 1, when the session reaches 00:01 and a second passes, it goes to 01:00. The tests expect the counter to reach to 00:00, wait for a whole second and then reset to the session/break length.

Fixing that fixed most tests for me.

Another thing, the alarm should beep at 00:00 not at 00:03 (or greater).

Try to fix this and then come back if there are more problems :smile:.