Skip to content

Commit cb7b6ef

Browse files
authored
Grouped tests cases
1 parent 9c84e3d commit cb7b6ef

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,21 @@ test(`Should return 11 when given an ace card`, () => {
99
expect(getCardValue("A♠")).toEqual(11);
1010
});
1111

12-
test(`Should return 10 when given a Joker card`, () => {
13-
expect(getCardValue("J♥")).toEqual(10);
14-
});
15-
16-
test(`Should return 2 when given the 2 card`, () => {
17-
expect(getCardValue("2♠")).toEqual(2);
18-
});
12+
// Case 2:
1913

20-
test(`Should return 10 when given a King card`, () => {
14+
test(`should return 10 for face cards"`, () => {
15+
expect(getCardValue("J♥")).toEqual(10);
2116
expect(getCardValue("K♠")).toEqual(10);
17+
expect(getCardValue("Q♣")).toEqual(10);
2218
});
2319

24-
test(`Should return 5 when given the 5 card`, () => {
20+
//Case 3:
21+
test(`should return the numeric value of numbered cards`, () => {
22+
expect(getCardValue("2♠")).toEqual(2);
2523
expect(getCardValue("5♠")).toEqual(5);
26-
});
27-
28-
test(`Should return 8 when gine the 8 card`, () => {
2924
expect(getCardValue("8♠")).toEqual(8);
3025
});
3126

32-
test(`Should return 10 when given the Queen card`, () => {
33-
expect(getCardValue("Q♠")).toEqual(10);
34-
});
3527
// Suggestion: Group the remaining test data into these categories:
3628
// Number Cards (2-10)
3729
// Face Cards (J, Q, K)

0 commit comments

Comments
 (0)