ccsync icon indicating copy to clipboard operation
ccsync copied to clipboard

Fix ReportsView Test Failure - Date Format Issue

Open Rustix69 opened this issue 11 months ago • 3 comments

Fix ReportsView Test Failure - Date Format Issue

Is your feature request related to a problem? Please describe.

The ReportsView component was incorrectly counting overdue tasks as 0 when they should have been counted properly. The issue was in the countStatuses function which filters tasks by date range.

Root Cause The original filter logic only included tasks where modifiedDate >= filterDate. This meant that overdue tasks with past due dates were being filtered out before they could be counted as overdue, since their due dates were before the filter date (e.g., before "today" or "start of week").

Rustix69 avatar Jan 01 '26 07:01 Rustix69

@its-me-abhishek The reason why the Test Coverage is failing in the PRs due to the Jan 01

If you run this test on: January 1-10: Past due date (10 days ago) falls in December → filtered out → overdue count = 0 January 11+: Past due date (10 days ago) falls in January → included → overdue count = 2

Rustix69 avatar Jan 01 '26 07:01 Rustix69

SnapShot :

Image

Rustix69 avatar Jan 01 '26 08:01 Rustix69

FIX : Modified the filter logic in ReportsView.tsx

  • Include tasks within the time range (original behavior)
  • Also include overdue pending tasks even if their due date is before the filter date, since overdue tasks should always appear in current reports
Image

@its-me-abhishek Should I create a PR ?

Rustix69 avatar Jan 01 '26 08:01 Rustix69