Pomodoro Clock Decrement Issue https://codepen.io/aduboisforge/pen/PLagOj

Hello everyone,

I’ve created a Pomodoro Clock with jQuery that passes all but two of the tests, for the Pomodoro clock FCC challenge. My plan was to create a clock in jQuery first, get it to pass all the tests, and then go back and create a clock with React, but I have not been able to get the clock to pass all the test in this first phase.

The two tests that are failing are concerned with the break decrement feature despite the fact that this feature seems to work correctly on my clock.

Here are the tests that are failing:

Fail 1:
When I click the element with the id of “break-decrement”, the value within id=“break-length” decrements by a value of 1, and I can see the updated value.

expected ‘5’ to equal '1’
AssertionError: expected ‘5’ to equal '1’

Fail 2:
I should not be able to set a session or break length to <= 0.
Value in element with id of “break-length” is less than 1.: expected ‘5’ to equal '1’

AssertionError: Value in element with id of “break-length” is less than 1.: expected ‘5’ to equal '1’

What is confusing me is the expected ‘5’ to equal ‘1’ part, when I look at other campers Pomodoro clocks that pass all the test, I see that when the tests are running their project have a one minute break and sessions lengths for the final tests. When my timer runs through all the tests it has a 1 minute session length and a 5 minute break length for the final tests, this seems to be why the test are actually failing, but I can’t figure out how to fix it.

I’m not sure if this is a bug in the testing suite, or if I made a mistake somewhere that I’m missing.

I’ve been hacking away at this issue for a couple days now. I’ve went through all of the closed issues on Github concerning the Pomodore clock, and changed my input elements to p elements to see if that would fix the issue.

I would appreciate any insight into this!

P.S. I stuck the link to my codepen in the title, because I’m new to this forum and cannot share links yet.

You have structured your clock so that you decrement the break length only when you click on the i element with class=“fas fa-caret-down”. The test expects the button element to be clickable to decrement the break length. Easy fix.

Although it is not something that is “wrong” per say, but I don’t think the sound should play when you first click on the Start button.

Thank you!!! So I stuck the onClick event call in the wrong place, can’t believe I missed that.

I’ll be changing the sound up here shortly, and I’ll take your advice on that, I was more concerned with passing the tests before adding extra bells and whistles to the clock, but appreciate it all the same.