Pomodoro clock appears to function properly but continues to fail tests?

Here is my clock: My Pomodoro Clock

After running the tests i get:

  • passes: 16
  • failures: 13
    Fails:
    #8 Content, #1,8-15 Timer, #1-3 Audio

But my clock seems to complete the challenges of the failed tests.
Not sure what is going on here.

And before I get a mountain of messages about not using React I’m testing my regular JS skills here.

so to start with #8, the time-left id issue? The container #time-left should contain the time remaining as a string, mm:ss - but yours contains two span elements. That could be messing you up.

I notice that when i click the start/stop button quickly many times it bugs out. Not sure if thats related to all these failures or how to resolve that.

But when I enter this in the console:
document.getElementById('time-left').textContent

I get:
" 25:00 "
Plus I really hope thats not the issue because my entire code is based on being able to seperate the time-left into minutes and seconds

you might want to take a look at the test code itself, over on the FCC github. I don’t know if it’s using textContent or what, to check that value.

I agree with @snowmonkey, I believe it’s due to you having it divided in the DOM as two separate elements, whereas the testing suite is attempting to parse the element #time-left as a singular entity. You could always split the element rather than hard coding it as two separate div's if your code relies on their separation.

1 Like

Yep having the #time-left div split in two was what was causing the problem. I’ve finally gotten around to retooling it. Thanks guys!

2 Likes