Conversation
big merge, please double check things
There was a problem hiding this comment.
Thinking a little bit from the frontend perspective, I have a handful of stray thoughts
- I'm back to thinking that maybe we should treat spectators as an implicit team. It would allow consumers to not have to think about spectators as a separate entity (since they'd all be grouped under the spectator team) but with the existence of a toggle for teams, I think this becomes awkward
- I call it out in a few spots, but it may be worth considering if we should include which player on a team performed an action alongside the action, both in the database and in generated chat messages. Doing it in the database if we want this will likely save headache in protocol v2.
Other miscellaneous comments
- Please use
array.forEachinstead offor (const elem of array). I know a lot of development environments have regressed back to suggesting that style of loop, but it's not the way we've been writing loops in this codebase. technically, it can require a polyfill, but we're not running the APi in the browser so it's not a major concern. ESLint would typically flag this if it was working correctly, at least in browser projects - There's quite a few places where the usage of helper methods is inconsistent. Go through with a fine toothed comb and make sure that helpers added in later iterations were properly used everywhere so there's no gotchas in 6 months when we inevitably need to make a change to it.
- It's possible I missed it in the sea of changes, but I don't see any handling for creating a team if aplayer switches from spectating to playing, or handling them leaving a team if they switch from playing to sepctatin. Both of these are existing options and separate actions, so we should take care to not break them
cjs8487
left a comment
There was a problem hiding this comment.
Sent my first review too early :/
| } from '../../database/Rooms'; | ||
|
|
||
| jest.mock('../../database/Rooms', () => ({ | ||
| addChangeColorAction: jest.fn().mockResolvedValue(undefined), |
There was a problem hiding this comment.
I've been putting mocks for the database directly into the respective mocks folder, and calling the module level mock for it from the setup script. This lets all the tests use the same mocks, which generally is the better paradigm, unless a test suite really needs specific mocks that don't match the other test. If you don't do it here, I may very well end up moving it, but I'd rather if we started some consistency
There was a problem hiding this comment.
Which mocks folder? I've neither seen one in main nor in your test branch. Needles to say it's not in my branch either
No description provided.