25 + 5 Clock: "Timer has not reached 00:00" Errors

Hey everyone, I’ve completed a basic timer in React using hooks however the tests are failing on the following points:

  • Timer: #1, #12, #13, #14, #15
  • Audio: #1

Timer has not reached 00:00.

Codepen

I don’t understand the error because I see the clock turn 0:00 for a full second. Does anyone have an idea of what it might mean? Thanks a lot for any help.

Most people faced this problem.
There should be enough time your app displayed 00:00 in order for the test spec to notice it. Usually what happened is as the time reached 00:00, your app react immediately to change the state before the test spec noticed that the time indeed reached 00:00. Just search this forum for posts of similar subject and you’ll figure out what to do.
I myself set my app to change state only when the timer hits -1000ms.

1 Like

Thanks for the reply @shugyoza ! It’s interesting that it’s happened to a lot of people, I have tried searching the forum but couldn’t find a solution so far.

It makes sense to throw an error for countdowns switching instantly after 00:01 but I’ve made sure that wasn’t happening with my app. Thanks for mentioning what worked for you - I’ve just tried adding an extra timeout wait to see if it would help the tests recognise the value at 00:00 but it still hasn’t solved it.

Work on the next one then. They might be related.

I realized that your problem is quite similar with what I had. So, this thread might be useful for you: 25+5 Clock: "Can't read properties of null" & "Timer hasn't reached 0"