-
-
Notifications
You must be signed in to change notification settings - Fork 267
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.
cjyuan
left a comment
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).
|
i did the changes that you have mentioned |
cjyuan
left a comment
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 PR description is now very informative.
When you have time, do checkout the Markdown syntax. It is used all over GitHub for formatting text.
| test("password has at least one symbol: (!, #, $, %, ., *, &)", () => { | ||
|
|
||
| const password = "abcd12"; | ||
| const password = "abcd!1"; | ||
| 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.
Something about this test is still not quite right. Can you fix the issue?
|
Your PR couldn't be matched to an assignment in this module. Please check its title is in the correct format, and that you only have one PR per assignment. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Looks good now. |
Learners, PR Template
Self checklist
Changelist
I have successfully completed all the assigned tasks, which include:
1- Editing the FIND.JS and PASSWORD-VALIDATOR.JS files as required.
2- Developing Jest test cases for the PASSWORD-VALIDATOR module to ensure its functionality.
Questions
No questions.