Skip to content

Commit f3203bb

Browse files
committed
added jest test for3-get-card-value
1 parent 54e91ad commit f3203bb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

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

1010
// Case 2: Handle Number Cards (2-10):
11+
test ("should return a 5 for the card with rank of 5 like(5♥) ",()=>{
12+
const fiveofHearts = getCardValue("5♥");
13+
expect(fiveofHearts).toEqual(5);
14+
15+
})
1116
// Case 3: Handle Face Cards (J, Q, K):
17+
test("shoild return 10 fore the faced cart like king(K♦) and queen (Q♣)")
18+
const kingCard =getCardValue("K♦");
19+
const queenCard= getCardValue("Q♣");
20+
expect(kingCard).toEqual(10);
21+
expect (queenCard).toEqual(10);
1222
// Case 4: Handle Ace (A):
23+
test("should return 11 for Ace of Spades", () => {
24+
const aceofSpades = getCardValue("A♣");
25+
expect(aceofSpades).toEqual(11);
26+
});
1327
// Case 5: Handle Invalid Cards:
28+
test ("should return invalid card rank for invalid inputs like(z♣)",()=>{
29+
const invalidCard= getCardValue("z♣");
30+
expect(invalidCard).toEqual("Invalid card rank.");
31+
});

0 commit comments

Comments
 (0)