Skip to content

Commit 14306cc

Browse files
committed
Add test cases to ensure correct ordinal output for 12, and 13
1 parent 03b238e commit 14306cc

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

Sprint-3/2-practice-tdd/get-ordinal-number.test.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,40 @@ test("should return '1st' for 1", () => {
1212
expect(getOrdinalNumber(1)).toEqual("1st");
1313
});
1414

15+
test("should return '2nd' for 2", () => {
16+
expect(getOrdinalNumber(2)).toEqual("2nd");
17+
});
18+
19+
test("should return '3rd' for 3", () => {
20+
expect(getOrdinalNumber(3)).toEqual("3rd");
21+
});
22+
23+
test("should return '4th' for 4", () => {
24+
expect(getOrdinalNumber(4)).toEqual("4th");
25+
});
26+
27+
test("should return '10th' for 10", () => {
28+
expect(getOrdinalNumber(10)).toEqual("10th");
29+
});
30+
1531
test("should return '11th' for 11", () => {
1632
expect(getOrdinalNumber(11)).toEqual("11th");
1733
})
1834

35+
test("should return '12th' for 12", () => {
36+
expect(getOrdinalNumber(12)).toEqual("12th");
37+
});
38+
39+
test("should return '13th' for 13", () => {
40+
expect(getOrdinalNumber(13)).toEqual("13th");
41+
});
42+
1943
test("should return '21st' for 21", () => {
2044
expect(getOrdinalNumber(21)).toEqual("21st");
2145
})
2246

23-
test("should return '2nd' for 2", () => {
24-
expect(getOrdinalNumber(2)).toEqual("2nd");
25-
})
47+
48+
49+
test("should return '111th' for 111", () => {
50+
expect(getOrdinalNumber(111)).toEqual("111th");
51+
});

0 commit comments

Comments
 (0)