fix(timesheets): request full page in history range test (PMS-507) #361
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-507-timesheet-history-range"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The integration test
list_timesheets_status_filter_and_rangebuilt its pagination viaPaginationParams::default(). That type derivesDefault, so::default()yieldsper_page = 0;per_page()then clamps zero up to one, producingLIMIT 1. The serde defaults (page=1, per_page=25) only apply when a query string is deserialized through the handler, never on a direct::default()in a service-level test. WithORDER BY week_start DESC LIMIT 1thestatus=alllisting returned only the newest (pending) week, soassert_eq!(all.len(), 3)failed with 1. The per-status assertions each expect exactly one row, so the clamp left them passing and masked the cap.Production is unaffected: the route handler deserializes
PaginationParamsfrom the query string and gets the serde defaultper_page = 25. The defect was confined to the test helper, which now constructs an explicit full page (page=1, per_page=100).#PMS-507