-
Notifications
You must be signed in to change notification settings - Fork 14
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 validation when a password is generated #2640
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.
Hey @EMaksy
Some comments.
-
I wouldn't export all the auxiliary functions. Just create a
isValidPassword
or similar, which includes all the other sub functions. And you can test this with all the cases. -
The sequential test looks complex. I would try to get inspiration in the code we have in the backend. It looks simpler: https://github.com/trento-project/web/blob/user_management/lib/trento/users/user.ex#L120
b15b788
to
35cc53a
Compare
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.
Really good!
Some comments in the tests, but good to go
expect(firstPassword).not.toBe(secondPassword); | ||
}); | ||
}); | ||
describe('isValidPassword', () => { |
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 would put some new lines between describe
and test
entries
Description
This pr aims to improve the password generation in order to support our password rules, as the current implementation has a very unlikely case not to meet the requirements.
Password Rules:
Also, this pr will ensure the unlikely case that e2e test fail if the generated password does not meet the requirements
It is a follow-up to @rtorrero comment: #2576 (comment)
How was this tested?
Added test for validation functions