Skip to content

Commit 76ef319

Browse files
test(billing): strengthen service-wiring assertions in admin param validation tests
CodeRabbit nit: tests asserting "reaches the service" now also verify the controller passed the validated param to the service method (getCustomerStatus called with orgId, purgeDeadLetter called with eventId).
1 parent a98b5a3 commit 76ef319

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

modules/billing/tests/billing.admin.integration.tests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@ describe('Billing admin integration tests:', () => {
488488
);
489489

490490
expect(res.status).toHaveBeenCalledWith(200);
491+
// Verify the validated orgId was passed through to the service (controller→service wiring)
492+
expect(BillingAdminService.getCustomerStatus).toHaveBeenCalledWith('507f1f77bcf86cd799439011');
491493
});
492494

493495
test('invalid orgId on POST /sync/:orgId returns 422', async () => {
@@ -547,6 +549,8 @@ describe('Billing admin integration tests:', () => {
547549
);
548550

549551
expect(res.status).toHaveBeenCalledWith(200);
552+
// Verify the validated eventId was passed through to the service (controller→service wiring)
553+
expect(BillingAdminService.purgeDeadLetter).toHaveBeenCalledWith('evt_1ABC');
550554
});
551555

552556
test('invalid orgId on POST /dispute/credit/:orgId returns 422', async () => {

0 commit comments

Comments
 (0)