Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests & bugfixes for user router #105

Merged
merged 11 commits into from
Oct 22, 2023
Merged

Conversation

Timothy-Gonzalez
Copy link
Member

@Timothy-Gonzalez Timothy-Gonzalez commented Oct 20, 2023

Resolves #94

This covers most of the code and edge cases that I think are reasonable to test. Only things not covered are mongod errors, but those are harder to test.

Tests for:

  • GET /user/qr/
  • GET /user/qr/:USERID/
  • GET /user/
  • GET /user/:USERID/
  • Remove POST /user/

Also applies a few misc bug fixes, namely typo stuff & returning wrong values.

Coverage from latest commit:

 src/services/user       |     100 |       95 |     100 |     100 |                                                                                                                                                                                 
  user-router.ts         |     100 |       95 |     100 |     100 | 111         

@Timothy-Gonzalez Timothy-Gonzalez marked this pull request as ready for review October 20, 2023 00:51
@Timothy-Gonzalez Timothy-Gonzalez self-assigned this Oct 20, 2023
Copy link
Contributor

@AydanPirani AydanPirani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some questions + suggested changes with HTTP codes

src/services/user/user-router.ts Outdated Show resolved Hide resolved
src/services/user/user-router.test.ts Outdated Show resolved Hide resolved
src/services/user/user-router.test.ts Outdated Show resolved Hide resolved
src/services/user/user-router.ts Outdated Show resolved Hide resolved
src/services/user/user-router.test.ts Outdated Show resolved Hide resolved
src/services/user/user-router.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@AydanPirani AydanPirani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! one thing we should do - add in a status code at some point

@Timothy-Gonzalez Timothy-Gonzalez merged commit ceb2a2d into main Oct 22, 2023
5 checks passed
@Timothy-Gonzalez Timothy-Gonzalez deleted the dev/timothy/user-tests branch October 22, 2023 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests for user service
2 participants