Skip to content

Commit b2a593c

Browse files
Apply changes asked by the reviewer
1 parent e16389e commit b2a593c

5 files changed

Lines changed: 8 additions & 5 deletions

File tree

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
@@ -58,5 +58,5 @@ assertEquals(reflex, "Reflex angle");
5858
const invalid1 = getAngleType(400);
5959
assertEquals(invalid1, "Invalid angle");
6060

61-
const invalid2 = getAngleType("400");
61+
const invalid2 = getAngleType("510");
6262
assertEquals(invalid2, "Invalid angle");

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ function isProperFraction(numerator, denominator) {
1414
numerator = Math.abs(numerator);
1515
denominator = Math.abs(denominator);
1616
if (numerator < denominator) return true;
17-
else if (numerator > denominator) return false;
18-
else if (numerator === denominator) return false;
17+
return false;
1918
}
2019

2120
// The line below allows us to load the isProperFraction function into tests in other files.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ test("should identify reflex angle (180° < angle < 360)", () => {
4040
// Case 6: Invalid angles
4141
test("should identify invalid angle (0 > angle > 360)", () => {
4242
expect(getAngleType(0)).toEqual("Invalid angle");
43+
expect(getAngleType(360)).toEqual("Invalid angle");
4344
expect(getAngleType(361)).toEqual("Invalid angle");
4445
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ test("should return false when both numerator and denominator are zero", () => {
1717
expect(isProperFraction(0, 0)).toEqual(false);
1818
});
1919

20-
// Case 2: Identify Improper Fractions:
21-
test("should return false for improper fraction", () => {
20+
// Case 2: Identify proper Fractions:
21+
test("should return true for proper fraction", () => {
2222
expect(isProperFraction(2, 3)).toEqual(true);
2323
});
2424

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ test("should return 10 for face cards", () => {
3535
test("Should return 'Invalid card rank.' for invalid cards", () => {
3636
expect(() => getCardValue("KJ")).toThrow("Invalid card rank.");
3737
expect(() => getCardValue("AK")).toThrow("Invalid card rank.");
38+
expect(() => getCardValue(" ")).toThrow("Invalid card rank.");
39+
expect(() => getCardValue("S♠")).toThrow("Invalid card rank.");
40+
expect(() => getCardValue("J♠♠")).toThrow("Invalid card rank.");
3841
});
3942

4043
// Suggestion: Group the remaining test data into these categories:

0 commit comments

Comments
 (0)