-
Notifications
You must be signed in to change notification settings - Fork 1
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
[CHE-199] Create Tests and Error Handling for userController registerUser #156
[CHE-199] Create Tests and Error Handling for userController registerUser #156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seantokuzo Great job on your first refactor and test ticket. 🎉
👍 I like the utility separation as well.
🛑 Left a couple comments and one request to delete the tests file. I think you can probably just go ahead and delete all the test files in that folder. Most of them wouldn't be recognizable after the reactors anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seantokuzo If we end up using this in the login flow as well, we will have to figure out how to deal with existing users that have passwords that don't meet this criteria.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'll need to use it for login, just enforcing stronger passwords when created. It's kind of overkill to abstract it out with just the 'password.length > 7' check, but good if we decide to enforce more conditions
…to CHE-199/subtask/Create-Tests-and-Error-Handling-for-userController-registerUser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seantokuzo Great work 🎉
Description
As part of the CHE-73/BE-Controller-Files story, this PR aims to:
registerUser
middleware into it's own file (in newserver/controllers/userController/
directory)registerUser
to make use of new error handlingregisterUser
Other things included with the changes above:
registerUser
import inuserRouter
registerUser
middleware fromuserController.ts
registerUser
tests that have been replacedJira Task
JIRA TICKET
Testing Instructions
npm run docker-test:solo register
to run new unit tests onregisterUser
middlewareserver/controllers/userController/registerUser/registerUser.test.ts
to make sure all possible request cases are coveredChecklist
All Team Members
npm run docker-build-check
in my local environment to check that this PR passes all linting and unit tests.