Having trouble passing Pomodoro Clock test

Hi everyone. I’m currently working on my Pomodoro clock project, still have to do the audio portion and the styling, but for the life of me I cannot figure out why one of the tests aren’t passing. The failing test is #8 in #Content:

time-left is not formatted correctly: expected ‘59’ to equal ‘60’

Here is the link to my code pen: https://codepen.io/lukezhang454/pen/BaBYJJO

Any help is appreciated, Thanks!

From my own experience doing pomodoro, you’re probably rendering something when some condition hits 60. Without it staying rendered to the dom for second so the test can say it’s passed. I used setTimeout for one second to wait after condition is hit.

1 Like

Thank you for the hint. My problem was I was setting the time state in ‘time-left’ after I did the render for sessionLength. I changed it so the session length and time-left is modified in the same render, and the test passed after some minor tweaking.

Hi, I have had the same issue and I figure out that it came from the way I have assigned the ids break-increment, break-decrement, session-increment and session-decrement. They were straight on my react-icons arrow up and down (seen as SVG in the DOM). So after I wrapped them all in a dedicated div with its id it worked fine.