Hi there,
Please I have almost completed the front-end development project Build a 25 + 5 Clock but I can’t pass three (03) tests out of 29. I have been trying to find the bug for several days now but I haven’t got any clue why these tests are not passing. I have used react and redux but I have not extracted state to redux yet. Here is the codepen link:
Here are the tests which are failing: User Story #23: 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.
User Story #25: 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.
User Story #27: The audio element with id="beep" must be 1 second or longer.
I have added code to read values from from the various html elements and I am replaying the sound when it ends to make it above 1 second but the test does not pass.
Use your favourite search engine to search for "beep sound effects"
There are also sound generators available online which create sounds \ beeps \ tones. Doing it this way, you will need a place to host them. I used GitHub to store a logo for a RWD project.
Hi Teller,
Thanks for your support. Unfortunately I tried your suggestions and I am still failing the tests. I still have 26/29. I expected two of the failing tests to pass but they are still failing. Please I have done a lot of research and I am overwhelmed. Please help me resolve this issue.
Okay you are right I should not be reading from DOM but I just changed to this after the code was failing to see if it will work. I was reading break length from state
let breakMinutesInMs = clock.breakLength * 60 * 1000;
Frankly I don’t understand “the break time for 1 minute starts from 59 second”. Please clarify me.
I have actually exahausted all my ideas on this code. Please try to run the tests with your corrections and see if the tests actually pass. I am somehow lost right now. If you assure me that the tests passes, then I will try to figure out the solution.
Hi @Billjay
Here is a video showing, near the end, the timer jumping from 00:00 to 00:59
This is a certification project, so you’ll need to experiment a bit, and find ways to resolve issues. If you’d like some feedback, please post your updated code so the forum can assist.
Thank you very much for giving me that tip and pushing me to the limit. I finally figured out why the clock was jumping from 00:00 to 00:59.
I passed the test and it now shows 29/29. I am so grateful for this great forum and freeCodeCamp. It has increased my motivation to continue and I am counting on your continuous support.