Skip to content

Conversation

@ahmadehsas
Copy link

@ahmadehsas ahmadehsas commented Oct 5, 2025

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist:

I have completed all the mandatory tasks. The changes I have made in the files are as below:

  • Sprint-3/1-key-implement
  • Sprint-3/2-mandatory-rewrite
  • Sprint-3/3-mandatory-practice

Questions

…he goal of this function is to count how many times a specific character appears in a given string
@github-actions
Copy link

github-actions bot commented Oct 5, 2025

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

@ahmadehsas ahmadehsas changed the title Birmingham | 25-ITP-Sep | Ahmad Ehsas | Sprint 3 | Structuring and Testing Data Birmingham | 25-ITP-Sep | Ahmad Ehsas | Sprint 3 | implement/rewrite-tests/practice-tdd Oct 29, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

@ahmadehsas ahmadehsas changed the title Birmingham | 25-ITP-Sep | Ahmad Ehsas | Sprint 3 | implement/rewrite-tests/practice-tdd Birmingham | 25-ITP-Sep | Ahmad Ehsas | Sprint 3 | Implement-and-rewrite-tests Oct 29, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

@ahmadehsas ahmadehsas added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 29, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

1 similar comment
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

@cjyuan
Copy link
Contributor

cjyuan commented Oct 29, 2025

  • The title is in the expected format. Good job.

  • The bot's message "Your PR description contained template fields" refers to the placeholder text "Briefly explain your PR.". You need to remove it to pass the automated test.

  • Your branch is still not yet updated. It is 6 commits behind CYF's main. You can use the "Sync Fork" function to update it.

  • Your branch still contains changed files (unrelated to Sprint-3 exercise) in "Sprint-1" folder. Can you revert those changes to make this PR clean?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 29, 2025
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

1 similar comment
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

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).

@ahmadehsas ahmadehsas added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 30, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Oct 30, 2025

Good job in keeping the branch updated. Now let's focus on keeping the branch clean.

On the upstream branch (CYF's main), the subfolders inside "Sprint-3" folder have been renamed. As a result, the filenames are all "messed up", and in short, that makes code reviewing difficult.

Can you transfer all of your changes to the files in these three subfolders, and then remove all other subfolders in "Sprint-3" folder?

  • Sprint-3/1-implement-and-rewrite-tests
  • Sprint-3/2-practice-tdd
  • Sprint-3/3-stretch

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 30, 2025
@ahmadehsas
Copy link
Author

ahmadehsas commented Oct 30, 2025 via email

@ahmadehsas ahmadehsas added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 30, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Oct 31, 2025

Thank you for your reviewing. I just have a question, should I make another
branch for ‘practice-tdd’ backlog or do that in the same branch?

Either way works.

Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

  • Good job in fixing the branch.

Comment on lines +12 to 22
if (angle === 90) return "Right angle";
if (angle < 90) return "Acute angle";
if (angle > 90 && angle < 180) return "Obtuse angle";
if (angle === 180) return "Straight angle";
if (angle > 180 && angle < 360) return "Reflex angle";

// read to the end, complete line 36, then pass your test here

if (angle === 90) {
return "Right angle";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You have some redundant code here.

Comment on lines +11 to 17
if (Math.abs(numerator) < denominator) return true; // This version of code works correctly for proper and negative fractions.
if (Math.abs(numerator) >= Math.abs(denominator)) return false;
if (Math.abs(numerator) === Math.abs(denominator)) return false;

if (numerator < denominator) {
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

  • What do you expect from isProperFraction(-2, -3)?

  • Some of the code is redundant.

Comment on lines +13 to +15
if (!isNaN(rank)) {
return Number(rank); // Number card
}
Copy link
Contributor

Choose a reason for hiding this comment

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

In JavaScript, strings that represent valid numeric literals in the language can be safely converted to equivalent numbers. For examples, "0x02", "2.1", "9e1" or "0002"

Do you want to recognize these string values as valid ranks?

Comment on lines +16 to +20
test("should return true for negative fractions", () => {
const negativeFraction = isProperFraction(-4, 7);
expect(negativeFraction).toEqual(true);
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Not all negative fractions are proper fractions. For example, -5/2.

If you allow negative denominator, then you could also test isProperFraction(4, -7), isProperFraction(-4, -7), isProperFraction(-7, 4), isProperFraction(-7, -4), isProperFraction(7, -4).

Comment on lines +29 to +52
test("throws an error or invalid card", () => {
expect(() => getCardValue("Z♠")).toThrow("Invalid card");
});

test("should throw error for malformed numeric input", () => {
expect(() => getCardValue("2.9999♠")).toThrow("Invalid card rank");
});

test("should throw error for repeated characters in rank", () => {
expect(() => getCardValue("3AAAA♠")).toThrow("Invalid card rank");
});

test("should throw error for number beyond valid range", () => {
expect(() => getCardValue("11♠")).toThrow("Invalid card rank");
});

test("should throw error for missing suit", () => {
expect(() => getCardValue("Q")).toThrow("Invalid card rank");
});

test("should throw error for non-string input", () => {
expect(() => getCardValue(5)).toThrow("Card must be a string");
});

Copy link
Contributor

Choose a reason for hiding this comment

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

  • Can you current implementation pass all these tests?

  • Why specifically test "repeated characters" in rank? What's so special about this particular string pattern?

  • "2.9999" is not really a malformed numeric value.

  • The function is not expected to check the suit character. Including a test for missing suit might send the wrong message to the person implementing the function.

Copy link
Contributor

Choose a reason for hiding this comment

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

image

The subfolder containing these two files were moved from its original folder.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants