Skip to content

Commit 11efcb1

Browse files
committed
Passed getCardvalue test
1 parent a2b2e06 commit 11efcb1

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ test("should return true for a proper fraction", () => {
77
});
88

99
// Case 2: Identify Improper Fractions:
10+
test("should return false for an improper fraction", () => {
11+
expect(isProperFraction(5, 4)).toEqual(false);
12+
});
1013

1114
// Case 3: Identify Negative Fractions:
15+
test("should return true for a negative fraction", () => {
16+
expect(isProperFraction(-1, 2)).toEqual(true);
17+
});
1218

1319
// Case 4: Identify Equal Numerator and Denominator:
20+
test("should return false for equal numerator and denominator", () => {
21+
expect(isProperFraction(3, 3)).toEqual(false);
22+
});

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,34 @@ test("should return 11 for Ace of Spades", () => {
88
});
99

1010
// Case 2: Handle Number Cards (2-10):
11+
test("should return 5 for Five of Hearts", () => {
12+
const fiveofHearts = getCardValue("5♥");
13+
expect(fiveofHearts).toEqual(5);
14+
});
1115
// Case 3: Handle Face Cards (J, Q, K):
16+
test("should return 10 for Jack of Diamonds", () => {
17+
const jackofDiamonds = getCardValue("J♦");
18+
expect(jackofDiamonds).toEqual(10);
19+
});
20+
test("should return 10 for Queen of Clubs", () => {
21+
const queenofClubs = getCardValue("Q♣");
22+
expect(queenofClubs).toEqual(10);
23+
});
24+
test("should return 10 for King of Hearts", () => {
25+
const kingofHearts = getCardValue("K♥");
26+
expect(kingofHearts).toEqual(10);
27+
});
1228
// Case 4: Handle Ace (A):
29+
test("should return 11 for Ace of Spades", () => {
30+
const aceofSpades = getCardValue("A♠");
31+
expect(aceofSpades).toEqual(11);
32+
});
1333
// Case 5: Handle Invalid Cards:
34+
test("should return Invalid card rank for an invalid card rank", () => {
35+
const invalidCard = getCardValue("1♣");
36+
expect(invalidCard).toEqual("Invalid card rank");
37+
});
38+
test("should return Invalid card rank for another invalid card rank", () => {
39+
const anotherInvalidCard = getCardValue("B♦");
40+
expect(anotherInvalidCard).toEqual("Invalid card rank");
41+
});

0 commit comments

Comments
 (0)