Test plansClinic app
Test Plan: Reports
Module: Clinic App — Patient Reports & Revenue Analytics
Code Audit Date: 2026-06-19
URLs: Patient Reports /cms/reports/patients | Revenue /cms/reports/revenue-v2
Status: 🔄 In Progress
SECTION 1: Patient Reports (✅ Complete — 18 tested)
| # | Test Case | Result | Bug |
|---|---|---|---|
| REP-01 | Load page | ✅ | |
| REP-02 | Loading state | ✅ | |
| REP-03 | Error state | ✅ | |
| REP-04 | Stats cards | ✅ | |
| REP-10 | Search by name | ✅ | |
| REP-10b | Search full name with space | ❌ | #31 |
| REP-11 | Gender filter | ✅ | |
| REP-12 | Birth date range | ✅ | |
| REP-13 | Age range filter | ✅ | |
| REP-14 | Category filter | ❌ | No data |
| REP-15 | Diagnoses filter | ❌ | No data |
| REP-16 | Medicines filter | ❌ | No data |
| REP-17 | Appointment type filter | ✅ | |
| REP-18 | Clear all filters | ✅ | |
| REP-20 | Pagination | ✅ | |
| REP-21 | Upload patient file | ✅ | |
| REP-22 | Export report | ❌ | #37 |
| REP-24 | Click row → detail | ❌ | #56 |
SECTION 2: Revenue — Summary Tab (✅ Complete)
| # | Test Case | Result | Bug |
|---|---|---|---|
| REV-01 | Earnings cards (total_revenue, received, pending) | ❌ | #57 |
| REV-02 | Visit type donut chart | ❌ | #59 |
| REV-03 | Payment method donut chart | ❌ | #57 |
| REV-04 | Service type donut chart | ⚠️ | Case-sensitive (known) |
| REV-05 | Revenue trend line chart | ✅ | |
| REV-06 | Loading state | ✅ | |
| REV-07 | Error state | ✅ | |
| REV-08 | Empty state | ✅ |
SECTION 3: Revenue — Services Tab
Component: ServicesTabV2.tsx
API: useAllServices({ facility_id, start_time, end_time, ...filters })
3.1 Filters
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| SV-01 | Search by service name | P0 | Type service name → debounced 300ms → filtered | Bug #61 ⚠️ |
| SV-02 | Search by patient name | P0 | Type patient name → 500 error (API bug) | Bug #62 ❌ |
| SV-03 | Clear search | P0 | Click X → resets | ✅ PASS |
| SV-04 | Filter by billing status — All | P0 | All (billed + unbilled) | ✅ PASS |
| SV-05 | Filter by billing status — Billed | P1 | Only invoiced | ✅ PASS |
| SV-06 | Filter by billing status — Unbilled | P1 | Only non-invoiced | ✅ PASS |
| SV-07 | Filter by payment status — All | P1 | Default | ✅ PASS |
| SV-08 | Filter by payment status — Paid | P1 | Only paid | ✅ PASS |
| SV-09 | Filter by payment status — Unpaid | P1 | Only unpaid | ✅ PASS |
| SV-10 | Filter by practitioner | P0 | Select doctor → filtered | ✅ PASS |
| SV-11 | Combined filters | P1 | Practitioner + billing + search | ✅ PASS |
3.2 Table Display
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| SV-15 | Columns visible | P0 | Service name, patient, practitioner, date, qty, price, discount, total, status | ⚠️ Patient = "NA" (Bug #62) |
| SV-16 | Amount formatting | P1 | Currency formatted (₹), correct total | ✅ PASS |
| SV-17 | Date formatting | P1 | Service date formatted | ✅ PASS |
| SV-18 | Data matches billing panel | P0 | Add service in billing → appears with same values | ✅ PASS |
3.3 Sort
Only date sort is available. Name + amount sort columns not implemented.
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| SV-20 | Sort by date | P1 | Click date → asc/desc | ✅ PASS |
3.4 Delete
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| SV-25 | Delete — dialog opens | P0 | Click trash → confirmation with reason | ⚠️ Modal shows {{patientName}} template (Bug #62) |
| SV-26 | Delete — confirm | P0 | Enter reason → Confirm → removed, list refreshes | ✅ PASS |
| SV-27 | Delete — cancel | P1 | Cancel → service stays | ✅ PASS |
| SV-28 | Delete — reason required | P1 | Empty reason → error | ✅ PASS |
3.5 Pagination
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| SV-30 | Next/prev page | P1 | Navigate between pages | ✅ PASS |
| SV-31 | Page size change | P1 | Change per_page → refetch | ✅ PASS |
| SV-32 | Page reset on filter change | P1 | Change filter → page resets to 1 | ✅ PASS |
SECTION 4: Revenue — Payments Tab
Component: PaymentsTabV2.tsx
API: useAllPayments({ facility_id, start_time, end_time, ...filters })
4.1 Filters
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| PV-01 | Search by patient name | P0 | Type name → debounced → filtered | Pending |
| PV-02 | Clear search | P0 | Click X → resets | Pending |
| PV-03 | Filter by payment method — Cash | P0 | Select "Cash" → only cash payments | Pending |
| PV-04 | Filter by payment method — Card | P0 | Select "Card" → only card payments | Pending |
| PV-05 | Filter by payment method — UPI | P0 | Select "UPI" → only UPI payments | Pending |
| PV-06 | Filter by payment method — Gateway | P1 | Select "Gateway" → shows gateway payments | Pending |
| PV-07 | Filter by status | P1 | Select status → filtered | Pending |
| PV-08 | Filter by practitioner | P0 | Select doctor → that doctor's payments | Pending |
4.2 Table Display
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| PV-15 | Columns visible | P0 | Payment #, method (icon), amount, patient, practitioner, date, status | Pending |
| PV-16 | Method icons | P1 | Cash=Banknote, Card=CreditCard, UPI=Smartphone, Bank=Building | Pending |
| PV-17 | Status badge | P1 | Completed/Pending/Cancelled with correct variant colors | Pending |
| PV-18 | Data matches billing panel | P0 | Add payment in billing → appears here with same values | Pending |
4.3 Edit
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| PV-20 | Edit — modal opens | P0 | Click pencil → edit modal with pre-filled amount, method, date, doctor | Pending |
| PV-21 | Edit — change amount | P0 | Change amount → Save → payment updated | Pending |
| PV-22 | Edit — change method | P1 | Change method → Save → reflected | Pending |
| PV-23 | Edit — cancel | P0 | Open → Cancel → no changes | Pending |
4.4 Cancel
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| PV-25 | Cancel — dialog opens | P0 | Click XCircle → confirmation with reason | Pending |
| PV-26 | Cancel — confirm | P0 | Enter reason → status changes to cancelled | Pending |
| PV-27 | Cancel — cancel dialog | P1 | Open → Cancel → payment stays | Pending |
4.5 Sort & Pagination
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| PV-30 | Sort by date | P1 | Click date → asc/desc | Pending |
| PV-31 | Sort by amount | P1 | Click amount → low-high/high-low | Pending |
| PV-32 | Pagination | P1 | Next/prev, page size | Pending |
SECTION 5: Revenue — Bills Tab
Component: BillsTabV2.tsx
API: useAllInvoices({ facility_id, start_time, end_time, ...filters })
5.1 Filters
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| BV-01 | Search by patient name | P0 | Type name → filtered | Pending |
| BV-02 | Clear search | P0 | Resets | Pending |
| BV-03 | Filter by status — Draft | P1 | "Draft" → only draft invoices | Pending |
| BV-04 | Filter by status — Paid | P1 | "Paid" → only paid invoices | Pending |
| BV-05 | Filter by status — Unpaid | P1 | "Unpaid" → only unpaid | Pending |
| BV-06 | Filter — Overdue only | P1 | Toggle overdue → only overdue bills | Pending |
5.2 Table Display
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| BV-10 | Columns visible | P0 | Invoice #, patient, date, total amount, paid, balance due, status, overdue badge | Pending |
| BV-11 | Status badge colors | P1 | Draft=muted, Paid=success, Unpaid/Overdue=destructive | Pending |
| BV-12 | Balance due calculation | P1 | Balance = total_amount - amount_paid | Pending |
| BV-13 | Data matches billing panel | P0 | Generate bill in billing → appears here | Pending |
5.3 Actions
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| BV-15 | Download PDF | P0 | Click download → PDF opens/downloads | Pending |
| BV-16 | Send via email | P1 | Click mail → invoice emailed to patient | Pending |
| BV-17 | Cancel bill | P1 | Click XCircle → confirm → status cancelled | Pending |
| BV-18 | Print bill | P2 | Click printer → browser print dialog | Pending |
5.4 Sort & Pagination
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| BV-20 | Sort by invoice date | P1 | Click date → asc/desc | Pending |
| BV-21 | Sort by invoice number | P1 | Click number → asc/desc | Pending |
| BV-22 | Pagination | P1 | Next/prev, page size | Pending |
SECTION 6: Revenue — Activity Tab
Component: ActivityLogsTabV2.tsx
API: useBillingActivityLogs({ facility_id, start_time, end_time, ...filters })
6.1 Filters
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| AV-01 | Search | P1 | Type → filtered by description/entity | Pending |
| AV-02 | Filter by entity type | P1 | Select invoice/payment/service → filtered | Pending |
| AV-03 | Filter by action | P1 | Select created/updated/deleted/cancelled → filtered | Pending |
6.2 Table Display
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| AV-10 | Columns visible | P1 | Timestamp, user, action, entity type, entity ID, description | Pending |
| AV-11 | Billing action appears | P0 | Add service/payment → log entry created | Pending |
| AV-12 | Delete action appears | P1 | Delete service/payment → log entry created | Pending |
| AV-13 | Cancel action appears | P1 | Cancel bill/payment → log entry created | Pending |
6.3 Sort & Pagination
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| AV-15 | Sort by timestamp | P1 | Click → asc/desc | Pending |
| AV-16 | Sort by action | P1 | Click → A-Z | Pending |
| AV-17 | Pagination | P2 | Next/prev, page size | Pending |
SECTION 7: Revenue — Date Range & Cross-Tab
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| DR-01 | Default — last month | P0 | Page opens with last month range | ✅ PASS |
| DR-02 | Change range — all tabs refetch | P0 | Set new range → Services, Payments, Bills all update | Pending |
| DR-03 | Preset — Last 7 days | P1 | Select preset → data scoped | Pending |
| DR-04 | Preset — Last 30 days | P1 | Select preset → data scoped | Pending |
| DR-05 | Preset — This month | P1 | Select → current month data | Pending |
| DR-06 | Custom range | P0 | Pick custom from/to → data scoped | ✅ PASS |
| DR-07 | Future dates blocked | P1 | Cannot select future end date | Pending |
| DR-08 | Tab switch preserves range | P0 | Set range → switch tabs → same range | Pending |
| DR-09 | Export — revenue report | P0 | Click Export → email → report sent | Bug #60 ❌ |
SECTION 8: Cross-Flow Integration
| # | Test Case | Priority | Expected | Status |
|---|---|---|---|---|
| INT-01 | Full flow: Book → Bill → all tabs | P0 | Book → add service → add payment → generate bill → verify Services/Payments/Bills tabs all show data correctly | Pending |
| INT-02 | Edit in billing → reflects in revenue | P1 | Edit service amount in billing panel → Services tab updated on refetch | Pending |
| INT-03 | Delete in billing → reflects in revenue | P1 | Delete payment in billing → Payments tab reflects | Pending |
| INT-04 | Revenue — facility scoped | P0 | Billing in Clinic A → only in Clinic A revenue | Pending |
🐛 Bugs Found
| Bug | Test | Description | Severity |
|---|---|---|---|
| #31 | REP-10b | Full name search with space → no results | 🟡 High |
| #37 | REP-22 | Export report — EFS permission denied | 🟡 High |
| #56 | REP-24 | Row click URL — patientId used twice | 🟡 High |
| #57 | REV-01 | Summary API — payments/earnings all zeros | 🟡 High |
| #59 | REV-02 | Visit type breakdown incorrect | 🟠 Medium |
| #60 | DR-09 | Revenue export — bill report API fails | 🟡 High |
Test Summary
| Section | Tests | Tested | Passed | Failed |
|---|---|---|---|---|
| 1. Patient Reports | 18 | 18 | 13 | 3 |
| 2. Summary Tab | 8 | 8 | 4 | 3 |
| 3. Services Tab | 23 | 0 | 0 | 0 |
| 4. Payments Tab | 22 | 0 | 0 | 0 |
| 5. Bills Tab | 15 | 0 | 0 | 0 |
| 6. Activity Tab | 9 | 0 | 0 | 0 |
| 7. Date Range & Cross-Tab | 9 | 1 | 1 | 1 |
| 8. Integration | 4 | 0 | 0 | 0 |
| Total | 108 | 27 | 18 | 7 |
Test Execution Order
- INT-01 — Full flow first (validates entire pipeline)
- Section 3: Services Tab (SV-01 → SV-32)
- Section 4: Payments Tab (PV-01 → PV-32)
- Section 5: Bills Tab (BV-01 → BV-22)
- Section 6: Activity Tab (AV-01 → AV-17)
- Section 7: Date Range & Cross-Tab (DR-01 → DR-09)
- Section 8: Integration (INT-01 → INT-04)
Status: 🔄 In Progress Last Updated: 2026-06-19