Skip to content

London | 26 ITP MAY | Russom Gebremeskel | Sprint 1 | Format Clock Edge Cases - #1629

Open
russom-g wants to merge 17 commits into
CodeYourFuture:mainfrom
russom-g:sprint-1/format-clock-edge-cases
Open

russom-g wants to merge 17 commits into
CodeYourFuture:mainfrom
russom-g:sprint-1/format-clock-edge-cases

Conversation

@russom-g

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1197

Changelist

Edge test cases written and tested. On the main function bugs fixed. Additional conditions written for checking multiple cases

@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 28, 2026

@abdishakoor-dev abdishakoor-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Russom. Your edge cases are thorough: midnight, noon, the minute either side of each, and the padding for 13:00. Small commits with clear names too.

One thing before I can mark this Complete. See my comment on timeConverter.test.js line 46.

Add the Needs Review label again once you've pushed.

});

test("correctly convert time after 12:00", function () {
assert.equal(formatAs12HourClock("23:00"), "11:00 PM");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The starter tests expected "11:00 pm" here and "08:00 am" on line 18. You changed them to PM and AM.

The given tests show the format the function must return. So change the code to match them. Do not change the tests to match the code.

Your own list on lines 56 to 65 uses am and pm too. Please use lowercase in the code and in all your tests.

@russom-g russom-g Sep 30, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PM and AM changed to lower case. Description for 23:00 ->11:00 pm corrected.

Starter test put back where they were. The reason I swapped the the two starter test cases was to make the whole test order to appear in chronological order.

Thanks for the feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Both starter tests expect "11:00 pm" and "08:00 am" again, and the code matches.

@abdishakoor-dev abdishakoor-dev added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 30, 2026
@russom-g russom-g added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 30, 2026

@abdishakoor-dev abdishakoor-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Russom. The code and all your tests use lowercase am and pm now, and all 12 tests pass.

Marking this Complete. Well done.

@abdishakoor-dev abdishakoor-dev added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants