Skip to content

Conversation

@vhscom
Copy link
Contributor

@vhscom vhscom commented May 20, 2024

Depends on: #2402

The grace period logic used considered a date of May 1st in the Q1 check-in logic. This was caused due to unexpected behavior adding a 1 month grace period. To address this issue, we instead use 30 days as the grace period.

Adds a test case which expresses the bug:
Q1 check-in date: Feb 12
Q2 check-in date: May 1

Before this update May 1 was being selected as the check-in for both the Q1 and Q2 reporting periods.
After this update May 1 is no longer selected as the check-in for the Q1 reporting period (Feb 12 is, as expected).

@vhscom vhscom force-pushed the bugfix-2212/reporting-edge-case branch from 46266e9 to e8b344a Compare May 20, 2024 18:39
expect(result.getMinutes()).toBe(30);
});

test('returns correct date when check-ins are on Feb 12 and May 1 with a report date in Q1', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Under previous logic this test would return 5/1 as the Q1 check-in date unexpectedly.

@vhscom vhscom force-pushed the bugfix-2212/reporting-edge-case branch from bfa8cbe to dd29ce1 Compare May 20, 2024 21:19
Copy link
Collaborator

@jackkeller jackkeller left a comment

Choose a reason for hiding this comment

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

Looks good!

@vhscom vhscom merged commit dd29ce1 into develop May 20, 2024
@vhscom vhscom deleted the bugfix-2212/reporting-edge-case branch May 20, 2024 21:50
@vhscom vhscom temporarily deployed to github-pages May 20, 2024 21:50 — with GitHub Actions Inactive
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.

4 participants