Skip to content

London | 26-ITP-May | Zadri Abdule | Sprint 3 | Implement & rewrite tests#1329

Open
Zadri415 wants to merge 8 commits into
CodeYourFuture:mainfrom
Zadri415:sprint-3-rewrite-tests
Open

London | 26-ITP-May | Zadri Abdule | Sprint 3 | Implement & rewrite tests#1329
Zadri415 wants to merge 8 commits into
CodeYourFuture:mainfrom
Zadri415:sprint-3-rewrite-tests

Conversation

@Zadri415

@Zadri415 Zadri415 commented Jun 2, 2026

Copy link
Copy Markdown

Learners, PR Template

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

Added Jest tests for Sprint-3 implement and rewrite (exercises 1–3)

@Zadri415 Zadri415 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module labels Jun 2, 2026

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

Very solid function implementation and tests.

Comment thread Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js Outdated
expect(isProperFraction(0, -100)).toEqual(true);
});

test(`should return true when absolute value of numerator is less than absolute value of denominator`, () => {

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.

Note: Using pseudocode and notations like abs(...) or | ... | is a common and widely accepted practice for describing conditions in a concise manner.

@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 Jun 5, 2026
@Zadri415 Zadri415 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 12, 2026
// execute the code to ensure all tests pass.

const validSuits = ["♠", "♣", "♥", "♦"];
const validRanks = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"];

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.

What's the purpose of preparing validRanks? Could using it simplify the solution?

});

// Case 6: Invalid angles
test(`should return "Invalid angle" when angle is not greater than 0`, () => {

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.

Why not simply express "not greater than 0" as <= 0? It's fine to use pseudocode or well-known notation in test descriptions when it makes them more concise. (Same for the "not less than 360")

In this case, <= is a widely recognized operator meaning "less than or equal to".

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.

... add a test to show that getCardValue checks the suit character too.

I could not find this test.

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

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants