momentum-mod / website

Momentum Mod's main website.
https://momentum-mod.org
MIT License
58 stars 59 forks source link

Unit test user creation #868

Closed tsa96 closed 8 months ago

tsa96 commented 10 months ago

User creation is obviously a very important, and we don't thoroughly test anywhere. Originally when we were only using E2E testing this wasn't possible, as we call Steam's API, but unit tests can easily mock those calls.

The auth calls to Steam are already well-tested, but the logic in findOrCreateFromWeb, findOrCreateFromGame and findOrCreateUser (all in users.service.ts) is not. All three of those methods need decent testing.

Nice easy issue, ofc tests aren't particular sexy, but this is a good introduction to unit tests for anyone unfamiliar with them.