Skip to content

Commit 23cb65d

Browse files
committed
refactoring and updating gitAngle function
1 parent 0967a9e commit 23cb65d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
function getAngleType(angle) {
1111
if (angle === 90) {
1212
return "Right angle";
13-
} else if (angle === 45) {
13+
} else if (angle > 0 && angle < 90) {
1414
return "Acute angle";
1515
} else if (angle > 90 && angle < 180) {
1616
return "Obtuse angle";

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ test("should identify right angle (90°)", () => {
1212
// Case 2: Identify Acute Angles:
1313
// When the angle is less than 90 degrees,
1414
// Then the function should return "Acute angle"
15+
test("should return Acute angle when the angle is less than 90 degrees", () => {
16+
expect(getAngleType(89)).toEqual("Acute angle");
17+
});
1518

1619
// Case 3: Identify Obtuse Angles:
1720
// When the angle is greater than 90 degrees and less than 180 degrees,

0 commit comments

Comments
 (0)