Skip to content

London | ITP-JAN-2026 | Said Fayaz Sadat | Sprint 3 | coursework/sprint-3/implement-and-rewrite-tests#1221

Open
fayaz551 wants to merge 15 commits intoCodeYourFuture:mainfrom
fayaz551:coursework/Sprint-3-implement-and-rewrite
Open

London | ITP-JAN-2026 | Said Fayaz Sadat | Sprint 3 | coursework/sprint-3/implement-and-rewrite-tests#1221
fayaz551 wants to merge 15 commits intoCodeYourFuture:mainfrom
fayaz551:coursework/Sprint-3-implement-and-rewrite

Conversation

@fayaz551
Copy link

@fayaz551 fayaz551 commented Mar 7, 2026

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

This PR addresses the Implement and Rewrite Tests backlog for Sprint 3. I have separated this from the main coursework branch to ensure correct validation by the GitHub bot.
Implemented functions in the implement folder to pass existing criteria.
Refactored and rewrote test suites in the rewrite-tests-with-jest folder to improve and follow Jest best practices.
Ensured all tests pass locally before submission.

Questions

n/a

@fayaz551
Copy link
Author

fayaz551 commented Mar 7, 2026

@cjyuan created new branch from main and transferred my work from old branch to new branch.

@fayaz551 fayaz551 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 7, 2026
@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 Mar 8, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 8, 2026

This description in the Changelist section does not quite explain what you have changed in this PR.

fixed the branches and PR to match the acceptance criteria of Sprint-3.

@fayaz551
Copy link
Author

fayaz551 commented Mar 8, 2026

This description in the Changelist section does not quite explain what you have changed in this PR.

fixed the branches and PR to match the acceptance criteria of Sprint-3.

updated the description to explain what have I done in this PR.

@fayaz551 fayaz551 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 Mar 8, 2026
@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 Mar 8, 2026
@fayaz551 fayaz551 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 Mar 8, 2026
@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 Mar 8, 2026
@fayaz551 fayaz551 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 Mar 9, 2026
Comment on lines +41 to +56
test(`should return "Invalid angle" when angle < 1 `, () => {
expect(getAngleType(-1)).toEqual("Invalid angle");
});

test(`should return "Invalid angle" when angle > 360 `, () => {
expect(getAngleType(361)).toEqual("Invalid angle");
});

// Largest valid angle(boundary case)
test(`should return "Straight angle" when angle is the maximum valid value (360)`, () => {
expect(getAngleType(360)).toEqual("Straight angle");
});
// Smallest valid angle(boundary case)
test(`should return "Acute angle" when angle is the minimum valid value (1)`, () => {
expect(getAngleType(1)).toEqual("Acute angle");
}); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

The "definition of angles" in these tests do not quite match the specification defined in
Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js.
Please check the specification and update these tests and the function accordingly.

Copy link
Author

Choose a reason for hiding this comment

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

updated the description and specification of test and function.

@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 Mar 9, 2026
@fayaz551 fayaz551 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 Mar 9, 2026
return "Straight angle";
}

return "Invalid angle";
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check carefully the specification on lines 4-9.

Comment on lines +53 to +56
// Smallest valid angle(boundary case)
test(`should return "Acute angle" when angle is the minimum valid value (1)`, () => {
expect(getAngleType(1)).toEqual("Acute angle");
}); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

You already have a test like this on line 11.

Comment on lines +41 to +52
test(`should return "Invalid angle" for angles less than 1°`, () => {
expect(getAngleType(-1)).toEqual("Invalid angle");
});

test(`should return "Invalid angle" for angles greater than 360°`, () => {
expect(getAngleType(361)).toEqual("Invalid angle");
});

// Largest valid angle(boundary case)
test(`should return "Straight angle" when angle is the maximum valid value (360)`, () => {
expect(getAngleType(360)).toEqual("Straight angle");
});
Copy link
Contributor

Choose a reason for hiding this comment

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

You could consider grouping all invalid cases into a category:

should return "Invalid angle" when angle <= _________ or angle >= _________.

and then test few invalid values, including both boundary cases.

Note: We can use symbols and notation if they help make the description more concise.

Comment on lines +33 to +35
test("should return false when denominator is zero", () => {
expect(isProperFraction(1, 0)).toBe(false);
}); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good category.

0/0 could be a good value to test.

});

// Category 3: Improper fractions (numerator >= denominator)
test("should return false when numerator is greater than or equal to denominator", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could consider making the description more precise as:

should return false when |numerator| > |denominator|

or

should return false when abs(numerator) > abs(denominator)

@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 Mar 10, 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.

2 participants