Skip to content

Add unit tests for FridayOfWeek date calculation#27

Merged
WZ merged 2 commits intofix/uncertainty-button-action-idsfrom
copilot/sub-pr-26
Feb 17, 2026
Merged

Add unit tests for FridayOfWeek date calculation#27
WZ merged 2 commits intofix/uncertainty-button-action-idsfrom
copilot/sub-pr-26

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

The FridayOfWeek function drives report filename generation and email subjects but had no test coverage, risking regressions in report naming and date labeling.

Changes

  • Added TestFridayOfWeek: Covers basic Monday→Friday conversion, time component preservation, and edge cases (year/month boundaries)
  • Added TestFridayOfWeekWithDifferentTimezones: Verifies timezone/location preservation across UTC, PST, JST
  • Test assertions: Validates returned date is Friday, time components (hour/minute/second) preserved, location unchanged

All tests verify the four critical aspects of date calculation functions: correct date result, weekday validation, time preservation, and timezone handling.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: WZ <719869+WZ@users.noreply.github.com>
Copilot AI changed the title [WIP] Update uncertainty buttons and report_private improvements Add unit tests for FridayOfWeek date calculation Feb 16, 2026
Copilot AI requested a review from WZ February 16, 2026 10:58
@WZ WZ marked this pull request as ready for review February 17, 2026 18:33
Copilot AI review requested due to automatic review settings February 17, 2026 18:33
@WZ WZ merged commit ffa1c96 into fix/uncertainty-button-action-ids Feb 17, 2026
@WZ WZ deleted the copilot/sub-pr-26 branch February 17, 2026 18:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive unit test coverage for the FridayOfWeek function, which is a critical date calculation utility used in report filename generation and email subject lines. The function had no test coverage prior to this PR, posing a regression risk.

Changes:

  • Added TestFridayOfWeek with table-driven tests covering basic Monday→Friday conversion, time component preservation, and edge cases at year/month boundaries
  • Added TestFridayOfWeekWithDifferentTimezones to verify timezone/location preservation across UTC, PST, and JST
  • All tests validate the four critical aspects of date calculation functions: correct date result, weekday validation, time component preservation, and timezone handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants