Skip to content

Sheffield| May 2025| Mayowa Fadare| Structure testing sprint 3 #633

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

mayowa0-7
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Made changes on the sprint 3 unit of the module structuring and testing, using the template provided

Questions

Ask any questions you have for your reviewer.

@mayowa0-7 mayowa0-7 added the Needs Review Participant to add when requesting review label Jul 2, 2025
Comment on lines 11 to 14
if (!isNaN(number) && number >= 2 && number <= 9) {
return number;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does your function return the value you expected from each of the following function calls?

getCardValue("2A♠");
getCardValue("5.1♠");
getCardValue("0x02♠");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked if the above function calls can return the expected value?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 3, 2025
@mayowa0-7 mayowa0-7 added Needs Review Participant to add when requesting review and removed Reviewed Volunteer to add when completing a review labels Jul 8, 2025
Comment on lines 21 to 23
test("Password must be at least 5 characters long.", () => {
expect(passwordValidator("Strong1!")).toBe(true);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also test if the function can return false when a password contains less than 5 characters.

Comment on lines 25 to 27
test("Password must include at least one uppercase letter.", () =>{
expect(passwordValidator("strong1")).toBe(false);
} )
Copy link
Contributor

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 "strong1" because

  1. it lacks an uppercase letter, OR
  2. it lacks a non-alphanumeric character

As a result, when the function return false, we cannot be certain exactly why it returns false.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 9, 2025
@mayowa0-7 mayowa0-7 added Needs Review Participant to add when requesting review and removed Reviewed Volunteer to add when completing a review labels Jul 10, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Jul 11, 2025

Changes look good.

Leaving responses directly in the comment threads makes tracking the discussion easier. You can try the approach in future PRs.

image

Here is a simplified version of best practices ChatGPT suggested for responding to inline comments in a pull request:

  • ✅ Reply to every comment – Let the reviewer know you saw it.
  • ✏️ Make the change if needed – Fix the code if the comment points out a real issue.
  • 🤔 Explain if you don't agree – If you think the code is fine, politely explain why.
  • ✅ Mark as resolved when done – Only mark comments resolved after you fix or respond.
  • 💬 Keep replies short and polite – Be respectful and to the point.
  • ⏱️ Respond soon – Don’t wait too long to reply.
  • 🧪 Test your changes – Make sure your fixes actually work.
  • 📍 Reply directly under the comment – This keeps the conversation easy to follow.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review labels Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants