Skip to content

Commit 7ce4235

Browse files
authored
Add Jest tests for getAngleType function
1 parent ac30244 commit 7ce4235

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ test("should identify right angle (90°)", () => {
99
// REPLACE the comments with the tests
1010
// make your test descriptions as clear and readable as possible
1111

12-
// Case 2: Identify Acute Angles:
13-
// When the angle is less than 90 degrees,
14-
// Then the function should return "Acute angle"
12+
// Case 2: Acute angle (<90°)
13+
test("should identify acute angles (<90°)", () => {
14+
expect(getAngleType(45)).toEqual("Acute angle");
15+
});
1516

16-
// Case 3: Identify Obtuse Angles:
17-
// When the angle is greater than 90 degrees and less than 180 degrees,
18-
// Then the function should return "Obtuse angle"
17+
// Case 3: Obtuse angle (>90° and <180°)
18+
test("should identify obtuse angles (>90° and <180°)", () => {
19+
expect(getAngleType(120)).toEqual("Obtuse angle");
20+
});
1921

20-
// Case 4: Identify Straight Angles:
21-
// When the angle is exactly 180 degrees,
22-
// Then the function should return "Straight angle"
22+
// Case 4: Straight angle (180°)
23+
test("should identify straight angles (180°)", () => {
24+
expect(getAngleType(180)).toEqual("Straight angle");
25+
});
2326

24-
// Case 5: Identify Reflex Angles:
25-
// When the angle is greater than 180 degrees and less than 360 degrees,
26-
// Then the function should return "Reflex angle"
27+
// Case 5: Reflex angle (>180° and <360°)
28+
test("should identify reflex angles (>180° and <=360°)", () => {
29+
expect(getAngleType(210)).toEqual("Reflex angle");
30+
});

0 commit comments

Comments
 (0)