Skip to content

Commit a08f8d8

Browse files
author
AlanGit-debug2604
committed
test: correct afternoon time conversion and add additional test cases for edge times
1 parent 7eb6e65 commit a08f8d8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎format-clock-edge-cases/timeConverter.test.js‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ test("can correctly convert noon time", function () {
2727
});
2828

2929
test("can correctly convert to single character afternoon time", function () {
30-
assert.equal(formatAs12HourClock("16:59"), "04:59 pm");
30+
assert.equal(formatAs12HourClock("16:00"), "04:00 pm");
31+
});
32+
33+
test("can correctly keep pm in first hour after noon", function () {
34+
assert.equal(formatAs12HourClock("13:00"), "01:00 pm");
3135
});
3236

3337
test("can correctly shows minutes input", function () {
34-
assert.equal(formatAs12HourClock("16:59"), "04:59 pm");
38+
assert.equal(formatAs12HourClock("13:30"), "01:30 pm");
3539
});
3640

3741
test("can correctly keep am in last minute of morning", function () {
@@ -41,3 +45,11 @@ test("can correctly keep am in last minute of morning", function () {
4145
test("can correctly keep pm in last minute of the day", function () {
4246
assert.equal(formatAs12HourClock("23:59"), "11:59 pm");
4347
});
48+
49+
test("can correctly keep am in first minute of the day", function () {
50+
assert.equal(formatAs12HourClock("00:01"), "12:01 am");
51+
});
52+
53+
test("can correctly keep pm in first minute after noon", function () {
54+
assert.equal(formatAs12HourClock("12:01"), "12:01 pm");
55+
});

0 commit comments

Comments
 (0)