Pomodoro clocks tests failing

Some tests are failing despite that they should not to.

Tests:

Timer:

  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.

  2. If the timer is paused and I click the element with id=“start_stop”, the countdown should resume running from the point at which it was paused.

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

  4. When a session countdown reaches zero (NOTE: timer MUST reach 00:00), a new break countdown should begin, counting down from the value currently displayed in the id=“break-length” element.

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

  6. When a break countdown reaches zero (NOTE: timer MUST reach 00:00), a new session countdown should begin, counting down from the value currently displayed in the id=“session-length” element.

Audio:

  1. When a countdown reaches zero (NOTE: timer MUST reach 00:00), a sound indicating that time is up should play. This should utilize an HTML5

I checked, it reaches “00:00”. I even used a

if(document.getElementById("time-left")){
            console.log(document.getElementById("time-left").innerHTML);
}

just to see if it’s display “00:00”. And it does. I’m pullin’ my hair figuratively here. Any suggestioon will be appreciated.
You can check out my codepen.

Edit1:
And image of an error which might come out of testing suite:

Edit2:
As i recently discovered, even FCC’s pomodoro fails tests sometimes. Sometimes in different browsers, sometimes on sundays, sometimes etc. …
Long story short, i devised new code, that addresses issues in previous edits i made. Still, it suffers same problems as forementioned fcc’s pomodoro. I read somewhere, something about timing events, whose implementation and execution depends on browsers and in this case test suite itself uses to, as also is my pomodoro. So there should be “conflicts” of sorts … Resolving these inconsistencies and conflicts, so that in every browser, in every suit/test, looks insurmountable and i guess would … What i’m trying to ask, is it ok if i submit my pomodoro, concerning everything being said?
My improved pomodoro.
Image of fcc’s pomodoro test fail:

Edit3:
Added comments that explain functioning in the code so feel free to browse.
Image of my test fail:


On the upper left you can see 28/29 passed tests.
Notice: you can see updated code in codepen together with comments.

Aside from the colour of the elements in the page being really dim, all functionality works for me. Perhaps it is your browser, and it would be worthwhile you console.log-ing within your browser to see if Javascript functionality is working.

I am using Chrome, and I have access to React Development tools.

I’m doing it with codepen and in my local environment. And in both cases it fails same tests. Going to try it in different browsers then i report back.
Edit:
Tried in different browsers and all displays same errors …
Edit2:
I even tried testing this with test suit in my local environment and it’s the same.

Your tests are running extremely slow, it took several minutes before the test finished, in my project it walks within a minute, but maybe that’s not important.

Another thing: the rate of refreshing the time is probably too slow, I’ve seen some jumps about TWO seconds difference while observing the source-code, eg: 00:37 -> 00:35. Maybe sometimes Zero is not displayed

@s-projects18 I was just currently experimenting. Try it now. I also console log current time so you can compare.

@s-projects18 I’m noticing something. In console its displayed correctly “00:00”, but in actual element with id="time-left, it jumps to “xx:59”. And there is no operations that interfere with let time variable which is inside a render method.

I’m curious about how you got the tests to run in a minute. I’ve been working on this, and the testing is the most annoying part because the tests need to let the timer run to 0 from its lowest possible setting (1min) and some tests need it to run through the break as well (2 min). Nothing like waiting 8 minutes just to know you fail on the same test…

That being said I finally passed all 29, but I’d still like to know how you got the tests to run faster than 8 minutes.

Just tested it and time jumped over to :59 without :00, but I cannot say whether this is random.

I don’t know. Probably it was just random or luck…
Maybe it is because I’m not using codepen, but codesandbox?

PS:
I just tested again and got an error in Firefox but in Chrome it was ok. Strange.