Pomodoro Clock - Can't Pass User Story #23

https://codepen.io/lamrock93/pen/VwZdgqr

Hello all. I’ve been working on the Pomodoro clock all day, and I’m at 28/29 tests passed. However, I can’t get User Story #23 to pass.

The error:
Timer has reached zero but didn’t switch to Break time: expected ‘Status: working’ to not equal ‘Status: working’
AssertionError: Timer has reached zero but didn’t switch to Break time: expected ‘Status: working’ to not equal 'Status: working’at Proxy.c (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js

I think the problem must be between lines 16 and 37. I’m using setTimeout on the functions which switch between session and break mode so that the clock hits 0. What’s also confusing is that I’m passing User Story #25, which is the same thing, but for the session time.

Hope that makes sense. Any help would be greatly appreciated.

Try adding setTimeout for waiting between condition triggering. Example: hitting certain condition makes rendering immediate that maybe label session gets changed to early. Or in other browsers rendering comes little late, or certain js features are differently implemented in other browsers … Aggregating to for later execution. To be safe of that pesky cache retention, i always ctrl+f5 …

1 Like

That’s a good idea - reloading the page did it… I can’t believe I didn’t try that.