-
-
Couldn't load subscription status.
- Fork 239
Glasgow | 25-ITP-Sep | Alaa Tagi| Sprint 3 | coursework/sprint 3 stretch #765
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
base: main
Are you sure you want to change the base?
Glasgow | 25-ITP-Sep | Alaa Tagi| Sprint 3 | coursework/sprint 3 stretch #765
Conversation
| test("password has at least one uppercase letter", () => { | ||
|
|
||
| const password = "1234a"; | ||
| const result = isValidPassword(password); | ||
| expect(result).toEqual(false); | ||
| } | ||
| ); |
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.
The function can return false for multiple reasons.
To test a specific reason, choose an input that satisfies all other conditions except the one you're targeting. This way, if the function returns false, you can confidently attribute it to that specific condition.
For example, the function might return false for "1234a" not only because it lacks an uppercase letter, but also because it lacks a special symbol.
As a result, we can't be certain that the function correctly handles the case of passwords without uppercase letters, since multiple conditions are being violated simultaneously.
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.
Can you make the PR description more informative (focusing on telling people what you have changed?)
In your current description:
I have created a PR with completed tasks as required.
- "have created a PR" -- This does not carry new info.
- "completed tasks" -- would be helpful to specify what the tasks are.
| test("password has at least one symbol: (!, #, $, %, ., *, &)", () => { | ||
|
|
||
| const password = "abcdA1"; | ||
| const password = "abcd12"; | ||
| const result = isValidPassword(password); | ||
| expect(result).toEqual(false); | ||
| } |
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.
There are two possible reasons the test could pass;
the new password does not contain any uppercase letter (in addition to not containing any symbol).
Learners, PR Template
Self checklist
Changelist
I have created a PR with completed tasks as required.
Questions
No questions.