Skip to content

Commit 7e1ce07

Browse files
committed
Improved the Tasks following the feedback instructions
1 parent caafa56 commit 7e1ce07

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,10 @@ function assertEquals(actualOutput, targetOutput) {
4444

4545
// TODO: Write tests to cover all cases, including boundary and invalid cases.
4646
// Example: Identify Right Angles
47-
const right = getAngleType(90);
48-
assertEquals(right, "Right angle");
47+
assertEquals(getAngleType(45), "Acute angle");
48+
assertEquals(getAngleType(90), "Right angle");
49+
assertEquals(getAngleType(120), "Obtuse angle");
50+
assertEquals(getAngleType(180), "Straight angle");
51+
assertEquals(getAngleType(270), "Reflex angle");
52+
assertEquals(getAngleType(-1), "Invalid angle");
53+
assertEquals(getAngleType(360), "Invalid angle");

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test("should return 'Reflex angle' when (180 < angle < 360)", () => {
3737
});
3838

3939
// Case 6: Invalid angles
40-
test("should return 'Invalid angle' when angle is invalid", () => {
40+
test("should return 'Invalid angle' when angle is < 0, >= 360, or not a number", () => {
4141
expect(getAngleType(-1)).toEqual("Invalid angle");
4242
expect(getAngleType(360)).toEqual("Invalid angle");
4343
expect(getAngleType(400)).toEqual("Invalid angle");

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ test("should return true when numerator is less than denominator", () => {
1212
});
1313

1414
// Case 2: Improper fractions (numerator >= denominator)
15-
test("should return false when numerator is greater than or equal to denominator", () => {
15+
test("should return false when |numerator| >= |denominator|", () => {
1616
expect(isProperFraction(2, 1)).toEqual(false);
1717
expect(isProperFraction(4, 3)).toEqual(false);
1818
expect(isProperFraction(5, 5)).toEqual(false);
19+
expect(isProperFraction(-2, 1)).toEqual(false);
20+
expect(isProperFraction(2, -1)).toEqual(false);
21+
expect(isProperFraction(-5, -5)).toEqual(false);
1922
});
2023

2124
// Case 3: Negative numbers

0 commit comments

Comments
 (0)