Skip to content

London | 26-ITP-Jan | Ebrahim Moqbel | Sprint 3 | Implement and Rewrite Tests#1194

Open
Ebrahim-Moqbel wants to merge 7 commits intoCodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework/sprint-3
Open

London | 26-ITP-Jan | Ebrahim Moqbel | Sprint 3 | Implement and Rewrite Tests#1194
Ebrahim-Moqbel wants to merge 7 commits intoCodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework/sprint-3

Conversation

@Ebrahim-Moqbel
Copy link

Learners, PR Template

Self checklist

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

Changelist

completed the implement and rewrite test as follows:

  • implemeted getAngleType and rewrote the test using jest
  • Implemented isProperFraction using jest tests
    -implemented getCardValue with validation and worte jest test using .toThrow() for invalid input

@Ebrahim-Moqbel Ebrahim-Moqbel added Complete Volunteer to add when work is complete and all review comments have been addressed. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 3 Assigned during Sprint 3 of this module Module-Structuring-And-Testing-Data The name of the module. and removed Complete Volunteer to add when work is complete and all review comments have been addressed. labels Mar 6, 2026
@favourO favourO added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Mar 12, 2026
Copy link

@favourO favourO left a comment

Choose a reason for hiding this comment

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

Nice work,
I left a few comments on specific blocks where the implementation and tests don’t quite match yet, and where there are a couple of small syntax or logic issues.

Once you address them, the PR should be in a good place.

}
if (!["♠", "♥", "♦", "♣"].includes(cardFace)) {
}
throw new Error(`Invalid card rank: ${rank}`);
Copy link

Choose a reason for hiding this comment

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

Can you confirm that the error messages in the implementation match what the tests expect?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you favourO. I have matched the function message thron error to the tests expectation.

// Suggestion: Group the remaining test data into these categories:
// Number Cards (2-10)
test(`Should return the correct value for number cards (2-10)`), () => {
expect(getCardValue("2♠")).toEqual(2);
Copy link

Choose a reason for hiding this comment

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

The test call here looks slightly mis-structured, the callback function appears to be outside the test(...) call.
It might be worth checking the syntax so the test runner can execute this block correctly.

expect(getCardValue("Q♠")).toEqual(10);
expect(getCardValue("K♠")).toEqual(10);
}
// Invalid Card suits
Copy link

Choose a reason for hiding this comment

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

Nice test cases.
Can you confirm that the implementation throw the same error messages that the tests expect here? we want to keep the behaviour predictable

also can you check if you properly closed the test block for this test(Should throw an error when given an invalid card suit)

@favourO favourO 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 Mar 12, 2026
Copy link

@favourO favourO left a comment

Choose a reason for hiding this comment

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

Great job

@favourO favourO added the Complete Volunteer to add when work is complete and all review comments have been addressed. label Mar 15, 2026
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 all review comments have been addressed. 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