Skip to content

Commit 331e4ff

Browse files
committed
the 3-get-card-value.test.js task has been solved
1 parent 4a5a46b commit 331e4ff

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

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

1010
// Case 2: Handle Number Cards (2-10):
11+
test("should return the numeric value for number cards (2-10)",()=>{
12+
const fiveofHearts = getCardValue("5♥");
13+
expect(fiveofHearts).toEqual(5);
14+
const tenofHearts = getCardValue("10♥");
15+
expect(tenofHearts).toEqual(10);
16+
});
1117
// Case 3: Handle Face Cards (J, Q, K):
18+
test("should return 10 for face cards (J, Q, K)",()=>{
19+
const kingofHearts = getCardValue("K♥");
20+
expect(kingofHearts).toEqual(10);
21+
const queenofHearts = getCardValue("Q♥");
22+
expect(queenofHearts).toEqual(10);
23+
});
1224
// Case 4: Handle Ace (A):
25+
test("should return 11 for an Ace",()=>{
26+
const aceofHearts = getCardValue("A♥");
27+
expect(aceofHearts).toEqual(11);
28+
});
29+
1330
// Case 5: Handle Invalid Cards:
31+
test("should return invalid card rank",()=>{
32+
const twelveofHearts = getCardValue("12♥");
33+
expect(twelveofHearts).toEqual("Invalid card rank")
34+
})

0 commit comments

Comments
 (0)