Front End Development Libraries Projects - Build a 25 5 Clock

Tell us what’s happening:
Hello! I’ve made a working version of 25+5 timer but it seems that 1 test is still missing for some reason and I cannot understand why.

14. 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.

*Timer has reached zero but didn’t switch back to Session time.: expected ‘Session’ to not equal ‘Session’

And the main thing - my element with id ‘timer-label’ IS changing perfectly…
Please help me to find my mistake or please clarify, what is wrong with my code?..

Thank you!

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Front End Development Libraries Projects - Build a 25 + 5 Clock

Link to the challenge:

somewhere in this clock reset function, this clock counter becomes like “0-36:00”, find that out where and adjust that bit of code, i bet it will be alright, happy coding :slight_smile:

I found out that changing the state inside changing another state can cause some troubles for the tests .
All tests passed now :slight_smile:

Moreover, -36 mistake is because the program is trying to multiclick both buttons - refresh and pause simultaneously while state is changing, and since I used several useState instead of one for each button ( for studying purposes) - that could bring the mistake, as states are asynchronous and don’t always change state in the right order. To remove this mistake I have to change all the code from zero (I will have to merge all the states into one), so while all the tests are passed - I will leave it for good and learn my lesson, ha-ha :)))

Thank you anyway for pushing my lazy ass to find what is going on…

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.