(Please ignore how I haven’t styled it at all)
So, besides the code being really janky it seems to me like it fulfills all the stories excepts its telling me it doesn’t reach 00:00 when it clearly does.
It also says the play and pause and pause doesn’t work, which it does when I try it but I admit that the test suite somehow breaks it.
Its the problem my janky code or did I somehow trigger a bug in the test suite?
Please do not undo moderator actions when a topic is moved to the appropriate category.
General is for topics that don’t fit in any of the categories.
When I tested your clock, there was a slight delay from when I pressed the button to when it actually starts.
That might be part of the issue.
Also, it seems to skip from 25:00 to 24:58.
I can tell you that if I change the session length a few times and reset a few times that at some point the play button stops working and won’t do anything when I click it.
After I run the test suite that also happens, so the problem probably lies there. Can you be a bit more specific with what you tried? I tried the following steps and it seemed to work:
- Start clock with default session length
- Let it run for a couple of seconds
- Increase/Decrease session length
- Repeat steps
Did you do something different or maybe did it in quick succession or something?
I would suggest you log out the state variables in different places, see if you can catch the state being inconsistent at some point. You can also use a method like componentDidUpdate to log out the state.
You also have a bit of pure DOM manipulation I would suggest you avoid and for the buttons, I’m not sure I really see why you need to use addEventListener. Not that you can’t use addEventListener but I wouldn’t suggest using it unless you need some global event listener on the document. For individual buttons, you should try to use the React event system.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.