Skip to content

Commit df7ccfb

Browse files
committed
Add more Jest test cases for getCardValue to include 2 and 10
1 parent 050e86a commit df7ccfb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@ test("should return 11 for Ace of Spades", () => {
99

1010
// Case 2: Handle Number Cards (2-10):
1111
test("should return the numeric value for number cards from 2 to 10", () => {
12-
const numberCard = getCardValue("7♥");
13-
expect(numberCard).toEqual(7);
12+
expect(getCardValue("7♥")).toEqual(7);
13+
expect(getCardValue("2♥")).toEqual(2);
14+
expect(getCardValue("10♥")).toEqual(10);
1415
})
16+
1517
// Case 3: Handle Face Cards (J, Q, K):
1618
test("should return 10 for face cards", () => {
1719
const faceCard = getCardValue("J♥");
1820
expect(faceCard).toEqual(10);
1921
})
22+
2023
// Case 4: Handle Ace (A):
2124
test("should return 11 for ace card", () => {
2225
const aceCard = getCardValue("A♥");
2326
expect (aceCard).toEqual(11);
2427
})
28+
2529
// Case 5: Handle Invalid Cards:
2630
test("should return invalid card rank for random numbers", () => {
2731
const invalidRandomCard = getCardValue("85♠");

0 commit comments

Comments
 (0)