Skip to content

Manchester | ITP-JAN-26 | Ofonime Edak | Sprint 3 | Coursework/sprint 3 implement and rewrite#1139

Open
Ofonimeedak wants to merge 7 commits intoCodeYourFuture:mainfrom
Ofonimeedak:coursework/sprint-3-implement-and-rewrite
Open

Manchester | ITP-JAN-26 | Ofonime Edak | Sprint 3 | Coursework/sprint 3 implement and rewrite#1139
Ofonimeedak wants to merge 7 commits intoCodeYourFuture:mainfrom
Ofonimeedak:coursework/sprint-3-implement-and-rewrite

Conversation

@Ofonimeedak
Copy link

@Ofonimeedak Ofonimeedak commented Mar 3, 2026

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

Angle functions
Proper fraction file
Resolved get Card Values
Write test with assertion
Rewrite test with Jest

This PR is on writing functions and carrying out unit test using JS assertion and jest

@github-actions

This comment has been minimized.

@Ofonimeedak Ofonimeedak 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. Module-Structuring-And-Testing-Data The name of the module. labels Mar 3, 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 Mar 3, 2026
@github-actions

This comment has been minimized.

@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 3, 2026
});

// Case 5: Reflex angles
test(`Should return "Reflex angle" when (180>angle<360)`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The notation (180>angle<360) is not consistent with the notation used on line 23.

});

// Case 6: Invalid angles
test(`Should return "Invalid angle" when (0 =<angle>=360)`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about (angle <= 0 or angle >=360)?

@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 11, 2026
@Ofonimeedak Ofonimeedak requested a review from cjyuan March 14, 2026 16:34
@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 14, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Some of the code is not consistently formatted.

Have you installed the prettier VSCode extension and enabled "Format on save/paste" on VSCode, as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md
?

If you have enabled "Format on save" but it is not working, it is likely that you haven't assign a formatter for JS file. This could happen if you have zero or multiple extensions that can format .js file.

If you have installed "Prettier" extension. To assign it as the formatter of JS code, you can try:

  1. Use "Format document" to format the JS file. Sometimes, VSCode will ask you to choose a formatter, and you can manually select "Prettier".
  2. Edit settings.json and set Prettier as the default formatter for JS.
    See: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

});

// Case 5: Reflex angles
test(`Should return "Reflex angle" when (360<angle>180)`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

360<angle>180 -- This notation seems to suggest "angle is greater than 360 and is greater than 180". Can you revise it?

Comment on lines 8 to 16
test(`should return false when denominator is zero`, () => {
expect(isProperFraction(1, 0)).toEqual(false);
expect(isProperFraction(1, -1)).toEqual(false);
expect(isProperFraction(10, 1)).toEqual(false);
expect(isProperFraction(1, 10)).toEqual(true);
expect(isProperFraction(-1, 0)).toEqual(false);
expect(isProperFraction(1e2, 1e4)).toEqual(true);
expect(isProperFraction(1e4, 1e0)).toEqual(false);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

The test description does not quite describe the tests being carried out.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 15, 2026
@Ofonimeedak Ofonimeedak requested a review from cjyuan March 16, 2026 09:35
@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 16, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Please note that in CYF courses, the recommended way to inform the reviewer of your changes is to do both of the following:

  • Reply to their feedback.
    • In the responses, clarify how each piece of feedback was addressed to demonstrate that you've carefully reviewed the suggestions.
      • You may find the suggestions in this PR Guide useful.
    • Your response may trigger a notification (depending on the reviewer's settings), helping ensure they’re aware of the updates you’ve made.
  • Replace the "Reviewed" label by a "Needs review" label (which you have done -- great!)
    • Without this label, the reviewer would not know if your changes is ready to be reviewed.

expect(isProperFraction(-2, 0)).toEqual(false);
expect(isProperFraction(-1, 0)).toEqual(false);
expect(isProperFraction(1, 0)).toEqual(false);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

These data categories and samples are not comprehensive enough. You should test also those proper and improper fraction samples you had in implement/2-is-proper-fraction.js.

Copy link
Author

Choose a reason for hiding this comment

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

Alright, I will improve the test case. Thank you very much

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 16, 2026
@Ofonimeedak Ofonimeedak requested a review from cjyuan March 20, 2026 09:39
@Ofonimeedak Ofonimeedak added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 20, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Changes look good.

Comment on lines +25 to +33
test(`should return true when denominator is > numerator `, () => {
expect(isProperFraction(1, 2)).toEqual(true);
expect(isProperFraction(1, 10000)).toEqual(true);

expect(isProperFraction(1e2, 1e3)).toEqual(true);
expect(isProperFraction(-1, 2)).toEqual(true);
});

test("should return false when denominator < numerator", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use pseudo-code such as abs(...) to more accurately state the condition when the function should return true or false.

Otherwise, isProperFaction(-100, 2) would be expected to return true because 2 > -100.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 20, 2026
@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 20, 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. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants