UNT-T21169 - Bugfix Login Issue#2
UNT-T21169 - Bugfix Login Issue#2priyanshu-simformsolutions wants to merge 1 commit intodevelopmentfrom
Conversation
nishchal-v
left a comment
There was a problem hiding this comment.
Please add some validation logic to mimic real bug fix scenario
4c15166 to
09e2593
Compare
| } | ||
|
|
||
| fun isValidEmail(email: String) = | ||
| email.isNotEmpty() && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches() |
There was a problem hiding this comment.
android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()
Would already fail if email is empty, or not?
There was a problem hiding this comment.
yes, it fails in Pattern Matcher
| VALID, INVALID_EMAIL, INVALID_PASSWORD | ||
| } | ||
|
|
||
| fun isValidLogin(email: String, password: String): ValidLogin { |
There was a problem hiding this comment.
Function name should have meaningful name
Are we authenticating the login?
As per my point of view, we are validating the login credential feilds.
There was a problem hiding this comment.
okay i have changed the name accordingly
a8c168b to
90a91f7
Compare
| } | ||
|
|
||
| fun isValidCredentials(email: String, password: String): ValidCredentials { | ||
| return if (isValidEmail(email)) { |
There was a problem hiding this comment.
Simplify the return using guard statements
fun isValidCredentials(email: String, password: String): String {
if (!isValidEmail(email)) return ValidCredentials.INVALID_EMAIL
if (!isValidPassword(email)) return ValidCredentials.INVALID_PASSWORD
...
}
There was a problem hiding this comment.
okay will follow it
Fix Forgot Password Click not working Fix Login Screen Password Check Add Validator.kt to perform Validations
90a91f7 to
c236d92
Compare
UNT-T21169 - Day4 - Bugfix/Login - ForgotPassword Issue
Fix:
Add: