It functions exactly according to the user stories but won’t pass the tests. I made sure all the required id’s were correct and on the right elements.
Part of the problem might be that there are setTimeout’s on all the increment/decrement handlers that allow an animation to run (It also makes the tests take a long time because they get caught trying to decrease the session lengths and only decrease them 1 before giving up and starting the timer). I tried taking these off but still didn’t pass those tests.
Also no clue why it thinks my time format (mm:ss) is wrong on the id=“time-left” element…
And ya, the layout is whack and the sounds are slow, this is just a quick codepen version to get the test suite to work
Get rid of all the animations The tests are running by a machine not someone is manually clicking and testing , meaning the test may click a button 1000 times in a ms to check whether its working.
I just finished this one. Not sure if this is the case here, but I used span id=“time-left” for my time display, and I was failing tests regarding clock not reaching 00:00 even though it was perfectly functional. I changed my time display to a div, and that fixed it… in your code you’re using h2 for your clock. Might want to see if that’s causing any issues (not sure what the test is checking for).
Thank you! This was exactly the problem for those tests, so weird. I moved the id onto the div containing the h2 and it worked, albeit very slowly.
No clue how the tests work, my noob guess would be some kind of difference depending if its testing for innerText vs. textContent (and probably not but vs. innerHTML?).
There’s so many different properties for each HTML element it’s kinda nuts. I’d actually be interested to know how it’s testing that!