Hey all, does anyone have any tips for the 25 + 5 clock project using React? I am aware of the test issues with React 18, I have already downgraded to React 17 but nearly all the timer specific tests are failing. Increment/decrement, even setting the break and session lengths seem to go above the boundaries, which they clearly do not. I am honestly at a loss. I’m wondering it refactoring to a class based component is worth the effort as I’ve seen some advice to do that? Otherwise does anyone have any pointers?
Here is a live version on Netlify - https://transcendent-narwhal-516573.netlify.app/
Here is the Github repo - https://github.com/SiAust/react-pomodoro/tree/fccTests
Here’s the tests result.
#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.
Timer has not reached 00:00.
FCC_Global</test/f/</s<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:168150
2. 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 '1' to equal '4'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.strictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:655
FCC_Global</test/</</t/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:173627
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
3. When I click the element with the id of "break-increment", the value within id="break-length" increments by a value of 1, and I can see the updated value.
expected '5' to equal '9'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.strictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:655
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:174069
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
4. When I click the element with the id of "session-decrement", the value within id="session-length" decrements by a value of 1, and I can see the updated value.
expected '1' to equal '21'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.strictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:655
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:174632
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
5. When I click the element with the id of "session-increment", the value within id="session-length" increments by a value of 1, and I can see the updated value.
expected '5' to equal '29'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.strictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:655
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:175185
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
6. I should not be able to set a session or break length to <= 0.
Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
createTimeoutError@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:261902
FCC_Global</</a/Kb.prototype._timeoutError@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:266162
FCC_Global</</a/Kb.prototype.resetTimeout/this.timer<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:264234
7. I should not be able to set a session or break length to > 60.
Value in element with id of "session-length" is greater than 60.: expected '41' to equal '60'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.strictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:655
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:176433
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
8. When I first click the element with id="start_stop", the timer should begin running from the value currently displayed in id="session-length", even if the value has been incremented or decremented from the original value of 25.
9. If the timer is running, the element with the id of "time-left" should display the remaining time in mm:ss format (decrementing by a value of 1 and updating the display every 1000ms).
25 + 5 clock has started but time displayed is not changing : expected +0 to be above +0
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:3191
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.isAbove@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:960
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:177611
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
10. If the timer is running and I click the element with id="start_stop", the countdown should pause.
25 + 5 has started but time displayed is not changing: expected '00' to not equal '00'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.notStrictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:736
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:178121
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
11. 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.
25 + 5 clock has started but time displayed is not changing: expected '00' to not equal '00'
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
h@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123
u@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130
FCC_Global</e.exports/n.notStrictEqual@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:736
FCC_Global</test/</</e/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:178845
p@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94539
FCC_Global</n/H/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:95877
FCC_Global</n/O/</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:94902
r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1169
s@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:1:1381
12. 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.
Timer has not reached 00:00.
FCC_Global</test/f/</s<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:168150
13. 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.
Timer has not reached 00:00.
FCC_Global</test/f/</s<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:168150
14. 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.
Timer has not reached 00:00.
FCC_Global</test/f/</s<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:168150
15. 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.
Timer has not reached 00:00.
FCC_Global</test/f/</s<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:168150
#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 <audio> tag and have a corresponding id="beep".
Timer has not reached 00:00.
FCC_Global</test/f/</s<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:168150
2. The audio element with id="beep" must be 1 second or longer.
3. The audio element with id of "beep" must stop playing and be rewound to the beginning when the element with the id of "reset" is clicked.
Audio element was not stopped when reset was clicked.: expected false to be true
a@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:82:477
FCC_Global</e.exports/o.prototype.assert@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:516:1451
FCC_Global</e.exports/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:15281
e@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:401:182
e@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:68:1382
FCC_Global</e.exports/n.isTrue@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:1196
FCC_Global</test/</</<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:184436
FCC_Global</</a/Kb.prototype.run/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:265533
FCC_Global</</a/Kb.prototype.run@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:265828
FCC_Global</</a/CC.prototype.runTest@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280794
FCC_Global</</a/CC.prototype.runTests/i/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:281730
o@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280133
FCC_Global</</a/CC.prototype.hooks/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280204
o@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:278952
FCC_Global</</a/CC.prototype.hook/<@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280018
Qv@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:14064