Skip to content

Commit 84776c6

Browse files
committed
fix: final test
1 parent 08b680c commit 84776c6

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

tests/billing_flow.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ describe('HMS Billing Flow Integration', () => {
6868
});
6969

7070
expect([200, 201]).toContain(res.statusCode);
71-
billId = res.body._id;
71+
72+
const bill = res.body.data || res.body;
73+
74+
billId = bill._id;
75+
7276
expect(billId).toBeDefined();
7377
});
7478

@@ -91,7 +95,7 @@ describe('HMS Billing Flow Integration', () => {
9195
});
9296

9397
expect(res.statusCode).toBe(200);
94-
const updatedBill = res.body;
98+
const updatedBill = res.body.data || res.body;
9599
expect(updatedBill.status).toBe('paid');
96100
});
97101
});

tests/patient.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ describe('Patient Integration Tests', () => {
6060
});
6161

6262
expect(res.statusCode).toBe(201);
63-
expect(res.body._id).toBeDefined();
63+
64+
const patient = res.body.data || res.body;
65+
66+
expect(patient._id).toBeDefined();
6467
});
6568

6669
it('should fail if missing required patient details', async () => {

tests/patient_flow.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ describe('HMS Patient Flow Integration', () => {
5454
});
5555

5656
expect(res.statusCode).toBe(201);
57-
expect(res.body._id).toBeDefined();
58-
patientId = res.body._id;
57+
58+
const patient = res.body.data || res.body;
59+
60+
expect(patient._id).toBeDefined();
61+
patientId = patient._id;
5962
});
6063

6164
it('2. Should fetch patient by ID (Verifying the 404 fix)', async () => {

0 commit comments

Comments
 (0)