Skip to content

London | 26-ITP-Sep | Mandip Sanger | Sprint 3 | Implement-and-rewrire-tests - #1612

Open
mandipsanger wants to merge 18 commits into
CodeYourFuture:mainfrom
mandipsanger:sprint-3/implement-and-rewrite-tests
Open

mandipsanger wants to merge 18 commits into
CodeYourFuture:mainfrom
mandipsanger:sprint-3/implement-and-rewrite-tests

Conversation

@mandipsanger

Copy link
Copy Markdown

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

Task code

CYF-1059

Changelist

Sprint 3 coursework

@github-actions

This comment has been minimized.

@mandipsanger mandipsanger changed the title London | 26-ITP-Sep | Mandip Sanger | Sprint 3/implement and rewrite tests London | 26-ITP-Sep | Mandip Sanger | Sprint3 | Implement-and-rewrire-tests Sep 8, 2026
@github-actions

This comment has been minimized.

@mandipsanger mandipsanger changed the title London | 26-ITP-Sep | Mandip Sanger | Sprint3 | Implement-and-rewrire-tests London | 26-ITP-Sep | Mandip Sanger | Sprint 3 | Implement-and-rewrire-tests Sep 8, 2026
@mandipsanger mandipsanger added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 8, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Sep 14, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Almost there, just a couple of small comments to fix

}

if (
rank === "2" ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This seems pretty complex, is there a way you could simplify checking these numbers?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That is much better, the duplicated block is gone. One thing on this same line though. Number(rank) accepts more than you might expect. Try getCardValue("2.1♠"), getCardValue("0002♠") and getCardValue("0x02♠"). What comes back, and what should come back?

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Sep 14, 2026
@mandipsanger mandipsanger 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 Sep 14, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You marked my comment about the fractions as resolved, but you don't seem to have addressed my comment. Did you understand it?

Also, did you run the tests before comitting and updating the PR? I get errors when I try to run it.

@LonMcGregor LonMcGregor 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 Sep 15, 2026
@mandipsanger mandipsanger removed the Reviewed Volunteer to add when completing a review with trainee action still to take. label Sep 15, 2026
@mandipsanger mandipsanger added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 15, 2026
@LonMcGregor

Copy link
Copy Markdown

I am still getting a lot of errors when I run the test. Do you also see these when you run the test command?

@LonMcGregor LonMcGregor 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 Sep 16, 2026
@mandipsanger

Copy link
Copy Markdown
Author

I have tested most of them now and will do it onces again. for rank i need to use loop and will push it soon.

@mandipsanger mandipsanger 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 Sep 16, 2026

@abdishakoor-dev abdishakoor-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Jest suite runs clean for me now, 19 tests passing, so that part is sorted. getAngleType is solid.

The fraction function is the main thing left.

  1. isProperFraction. A fraction is proper when the numerator is smaller than the denominator ignoring the minus signs. So -4/-5 is proper, and so is 1/-5. Your function returns false for both, and your tests on lines 34 and 38 say false is correct. It is the function that needs to change here, and then those two tests. One more to think about: what should isProperFraction(-2, 1) be, and what does your function return for it now?

  2. getCardValue accepts some cards it should reject. See my reply on the Number(rank) line.

Add the Needs Review label again when you have pushed.

@abdishakoor-dev abdishakoor-dev 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 Sep 18, 2026
@mandipsanger mandipsanger 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. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 21, 2026
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mandipsanger mandipsanger added NotCoursework Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed NotCoursework labels Nov 21, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 21, 2026
@mandipsanger mandipsanger added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 21, 2026
@github-actions

Copy link
Copy Markdown

The files changed in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the 'files changed' tab at the top of the page.

Here is an example of a file that has been changed on this branch but shouldn't be: Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

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

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants