Js/react calculator

Hi all.
I had initially finished this project, but realized it’s better without redux, as I had done that all wrong. Clearly redux is for a later date and for now I’ll focus on JS/react.
Anyway, I’m getting errors, off course. Hopefully , someone can point out why ? :slight_smile:

codepen

9 out of 16 pass at least.

Thanks

“Numbers do not display correctly within id=“display” : expected ‘0’ to equal ‘123’”

if I could understand why it complains about this, that would be very helpful. Obviously I can see the numbers correctly, I’m just baffled. I really would like to just understand what I’m doing wrong. It might be something very minor that messes it all up.
:slight_smile:

remove async await 's , 16/16 sigh
congrats!

1 Like

Thank you , I will try that later tonight when I have more time. :slight_smile:

Only question I have is, I thought it’s good to use something like async/await or promises to synchronize using setState ?

Thanks , that solved it ! :slight_smile:

I’m having a similar problem with my 25 + 5 clock.
codepen

would you be willing to take a look. I got rid of the asyncs/awaits, but it’s complaining of similar problems maybe:

8. 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).

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

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

Timer has not reached 00:00.

9. 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).

25 + 5 clock has started but time displayed is not changing : expected 0 to be above 0

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

Timer has not reached 00:00.

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 not reached 00:00.

Maybe you have an idea ? I would like to know what I did wrong, so I don’t make them again, hopefully. Thanks ! :slight_smile: