Skip to content

Commit f6b1388

Browse files
test.js added five extra tests namely midnight, single hour morning, due characters morning, noon time, and shows minutes
1 parent 8b179f7 commit f6b1388

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,25 @@ test("correctly convert time after 12:00", function(){
77
});
88

99
test("can correctly convert morning time", function() {
10-
assert.equal(formatAs12HourClock("08:00"), "08:00 am");
10+
assert.equal(formatAs12HourClock("08:00"), "8:00 am");
1111
});
12+
13+
test("can correctly convert midnight time", function() {
14+
assert.equal(formatAs12HourClock("00:00"), "12:00 am");
15+
});
16+
17+
test("can correctly convert single character hour morning time", function() {
18+
assert.equal(formatAs12HourClock("09:00"), "9:00 am");
19+
});
20+
21+
test("can correctly convert dual characters hour morning time", function() {
22+
assert.equal(formatAs12HourClock("11:00"), "11:00 am");
23+
});
24+
25+
test("can correctly convert noon time", function() {
26+
assert.equal(formatAs12HourClock("12:00"), "12:00 pm");
27+
});
28+
29+
test("can correctly shows minutes input", function() {
30+
assert.equal(formatAs12HourClock("16:59"), "4:59 pm");
31+
});

0 commit comments

Comments
 (0)