diff --git a/tests/billing.test.js b/tests/billing.test.js index c1aa665..7e51ee7 100644 --- a/tests/billing.test.js +++ b/tests/billing.test.js @@ -59,7 +59,8 @@ describe('Billing Integration Tests', () => { .set('Authorization', `Bearer ${adminToken}`) .send({ patient: 'patId', - amount: 1500 + amount: 1500, + paymentMode: 'cash', // appointment is optional per controller }); diff --git a/tests/billing_flow.test.js b/tests/billing_flow.test.js index bb31f6f..3c83496 100644 --- a/tests/billing_flow.test.js +++ b/tests/billing_flow.test.js @@ -63,11 +63,12 @@ describe('HMS Billing Flow Integration', () => { patient: patientId, amount: 500, status: 'pending', + paymentMode: 'cash', items: [{ desc: 'Consultation', price: 500 }] }); expect([200, 201]).toContain(res.statusCode); - billId = res.body.data?._id || res.body._id; + billId = res.body._id; expect(billId).toBeDefined(); }); @@ -90,7 +91,7 @@ describe('HMS Billing Flow Integration', () => { }); expect(res.statusCode).toBe(200); - const updatedBill = res.body.data || res.body; + const updatedBill = res.body; expect(updatedBill.status).toBe('paid'); }); });