London | ITP-JAN-2026 | Said Fayaz Sadat | Sprint 3 | coursework/sprint-3/implement-and-rewrite-tests#1221
Conversation
|
@cjyuan created new branch from main and transferred my work from old branch to new branch. |
Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js
Outdated
Show resolved
Hide resolved
|
This description in the Changelist section does not quite explain what you have changed in this PR.
|
…get-value-card to test file
…id angle check in the beginning
|
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js
Show resolved
Hide resolved
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
updated the description and specification of test and function.
| return "Straight angle"; | ||
| } | ||
|
|
||
| return "Invalid angle"; |
There was a problem hiding this comment.
Please check carefully the specification on lines 4-9.
| // 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 |
There was a problem hiding this comment.
You already have a test like this on line 11.
| 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"); | ||
| }); |
There was a problem hiding this comment.
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.
| test("should return false when denominator is zero", () => { | ||
| expect(isProperFraction(1, 0)).toBe(false); | ||
| }); No newline at end of file |
There was a problem hiding this comment.
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", () => { |
There was a problem hiding this comment.
Could consider making the description more precise as:
should return false when |numerator| > |denominator|
or
should return false when abs(numerator) > abs(denominator)
Learners, PR Template
Self checklist
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