Skip to content

London | 26-ITP-May | Liridona Shehu | Sprint 3 | Implement and rewrite#1474

Open
shehu-dona wants to merge 23 commits into
CodeYourFuture:mainfrom
shehu-dona:coursework/sprint-3-implement-and-rewrite
Open

London | 26-ITP-May | Liridona Shehu | Sprint 3 | Implement and rewrite#1474
shehu-dona wants to merge 23 commits into
CodeYourFuture:mainfrom
shehu-dona:coursework/sprint-3-implement-and-rewrite

Conversation

@shehu-dona

@shehu-dona shehu-dona commented Jul 6, 2026

Copy link
Copy Markdown

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

A PR with exercises using Jest

@github-actions

This comment has been minimized.

@shehu-dona shehu-dona 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. labels Jul 6, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026
@shehu-dona shehu-dona added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 6, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026
@shehu-dona shehu-dona added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026
@github-actions

This comment has been minimized.

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

This comment has been minimized.

@shehu-dona shehu-dona added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026
@shehu-dona shehu-dona added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 6, 2026
@Luro91 Luro91 added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 9, 2026

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

I have a couple of comments

else if( angle > 180 && angle < 360){
return "Reflex angle";
}
else return "Invalid angle";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FYI: You don't need the else here as the code will only run if no other condition was true

Comment on lines +19 to +31
if( angle > 0 && angle < 90){
return "Acute angle";
}
else if (angle === 90){
return "Right angle";
}
else if ( angle > 90 && angle < 180){
return "Obtuse angle";
}
else if(angle === 180){
return "Straight angle";
}
else if( angle > 180 && angle < 360){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I see some white spaces in the conditions that are not needed. How can you ensure consistent formatting in your code?

test(`should return "Invalid angle" when (180 < angle < 360)`, () => {
// Test various invalid angles, including boundary cases
expect(getAngleType(0)).toEqual("Invalid angle");
expect(getAngleType(360)).toEqual("Invalid angle");

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 could add 2 test cases that are not boundary cases

Comment on lines +25 to +31
// Special case: numerator is negative is a proper fraction
test(`should return false when numerator is negative value`, () => {
expect(isProperFraction(-1, 2)).toEqual(false);
});


// Special case: denominator is negative is a proper fraction

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 comments say is a prober fracteion but the function should return false. This is confusing

});


// Special case: negative numerator with smaller value then negative dominator is a proper fraction

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 comments say is a prober fracteion but the function should return false. This is confusing

Comment on lines +30 to +40
const validRanks = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"];
const validSuits = ["♠", "♥", "♦", "♣"];

let isValidRank = validRanks.includes(rank);
let isValidSuit = validSuits.includes(suit);



// Invalid Card
if( !isValidRank || !isValidSuit ){
throw new Error("Invalid Card")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thats a nice way of checking if the input is valid. By expliciting stating all allowed values that code is easy to understand

Comment on lines +45 to +51
// test(`Should throw an error when given an invalid card`, () => {
// expect(() => getCardValue("1♠")).toThrow();
// expect(() => getCardValue("Z♦")).toThrow();
// expect(() => getCardValue("11♥")).toThrow();
// expect(() => getCardValue("")).toThrow();
// });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this code commented out?

@Luro91 Luro91 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 Jul 9, 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.

3 participants