Skip to content

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

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

mandipsanger wants to merge 16 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

Comment thread Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js Outdated
@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

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.


function isProperFraction(numerator, denominator) {
// TODO: Implement this function
if (denominator <= 0) {

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 guard is what makes -4/-5 and 1/-5 come out false. If you compare the sizes of the two numbers ignoring their signs, do you still need it? Check your two zero-denominator tests still pass after the change.

});

test("should return false when denominator is negative", () => {
expect(isProperFraction(1, -5)).toEqual(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1/-5 is a proper fraction, because 1 is smaller than 5. This test says false, which matches your code rather than the maths. Line 38 has the same problem.

@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
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