pelagia-portal/App/tests/unit
Hardik 47ac2c7813
All checks were successful
PR checks / checks (pull_request) Successful in 48s
PR checks / integration (pull_request) Successful in 31s
feat(reports): weekly granularity, custom compare, line-item allocation
Picks up the three pieces deferred from the initial reports PR:

#3 Line-item account allocation — allocatePoSpend() splits each PO across the
accounting codes its line items carry (line accountId, falling back to the
PO-level account), proportionally so per-PO rows sum back to totalAmount. The
accounting-code report now attributes multi-account POs correctly. SpendRow
gains poId; poCount is now distinct POs, not row count.

#2 Custom "Add to graph" — tick rows on either index (SelectCheckbox links
write ?sel=id1,id2), then "Compare selected" (?cmp=1) shows a custom comparison
of just those entities. Fully server-rendered + shareable; export honours sel.

#1 Weekly granularity — a third Granularity that focuses one FY month and
buckets spend by week-of-month (W1–W5) from approvedAt, with a Month picker in
the toolbar. Real buckets (not the mockup's synthetic split).

All three are URL-driven like the rest, so no client fetching. Charts/KPIs/
detail trends all branch on the new mode.

Tests: +8 unit cases (allocation proportional/fallback/empty, weekly buckets,
sel parse/toggle, month + granularity parsing); fixture updated for poId/week.
Full unit suite 311 green; tsc clean. Smoke-tested weekly + custom-compare +
exports end-to-end (all 200). Docs + wiki updated to mark them implemented.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 11:25:05 +05:30
..
application-pipeline.test.ts feat(crewing): Phase 3b — recruitment pipeline (flagged) 2026-06-22 18:49:12 +05:30
appraisal-state-machine.test.ts feat(crewing): Phase 5b — appraisal (flagged) 2026-06-22 22:09:32 +05:30
attachments.test.ts fix(po): show all attachments grouped by type on PO details 2026-06-19 04:43:44 +05:30
cancel-po-controls.test.tsx fix(po): make cancel buttons red & visible (use defined danger tokens) 2026-06-21 12:59:20 +05:30
crew-pii.test.ts fix(crewing): mask Aadhaar/PAN document numbers server-side 2026-06-22 23:29:11 +05:30
image-size.test.ts fix(po): size XLSX export images by pixels (aspect preserved) 2026-06-21 13:27:15 +05:30
pagination.test.ts feat(history): paginate PO history with items-per-page control 2026-06-24 03:26:47 +05:30
permissions-crewing.test.ts feat(crewing): admin crew management — direct placement, CRUD, strength config 2026-06-22 21:23:31 +05:30
permissions.test.ts feat(po): submitter view-all of POs + History + export (feature-flagged) 2026-06-22 04:57:11 +05:30
po-export-layout.test.ts fix(po): keep the export stamp clear of the signature (no overlap) 2026-06-21 15:35:09 +05:30
po-import-parser.test.ts test+ci: green the test baseline and make type-check + unit tests hard gates 2026-06-19 13:03:54 +05:30
po-line-items-editor.test.tsx feat(po): add week, month, year to line-item unit options 2026-06-21 00:32:39 +05:30
po-state-machine.test.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
po-status-badge.test.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
reports.test.ts feat(reports): weekly granularity, custom compare, line-item allocation 2026-06-24 11:25:05 +05:30
requisition-state-machine.test.ts feat(crewing): Phase 2 — requisitions + relief requests (flagged) 2026-06-22 18:22:59 +05:30
sidebar.test.tsx feat(reports): Purchasing spend analytics (Cost Centres + Accounting Codes) 2026-06-24 07:52:23 +05:30
storage-keys.test.ts feat(po): per-company logo, stamp & brand bar on exported POs 2026-06-21 01:17:23 +05:30
utils.test.ts feat(dashboard): compact INR formatting for Total Approved Spend card 2026-06-21 02:02:41 +05:30
validations.test.ts feat(po): allow submitter to set an optional PO date 2026-06-16 13:06:12 +05:30
vendor-select.test.tsx feat(po): make vendor field a searchable combobox 2026-06-24 05:16:57 +05:30
vendors-table.test.tsx refactor(routes): move /inventory/{items,vendors} → /catalogue/{items,vendors} 2026-06-24 05:04:29 +05:30