add(feat): verification

This commit is contained in:
2026-02-18 17:01:41 +07:00
parent c52ecd6514
commit dd09ff0511
15 changed files with 90 additions and 16 deletions

View File

@@ -17,13 +17,18 @@ const cstoreService = require('../../app/modules/cstore/services/cstore.service'
describe('CStoreService', () => {
beforeEach(() => {
jest.clearAllMocks();
process.env.PROJECT_ID = 'CBT';
});
it('should create an indomaret transaction successfully', async () => {
const payload = { order_id: 'u-123', external_id: 'INV-I-001', amount: 50000 };
mockCharge.mockResolvedValue({ status_code: '201' });
const result = await cstoreService.createTransaction(payload, 'indomaret');
expect(mockCharge).toHaveBeenCalled();
expect(mockCharge).toHaveBeenCalledWith(expect.objectContaining({
transaction_details: expect.objectContaining({
order_id: 'INV-I-001-CBT'
})
}));
});
it('should create an alfamart transaction successfully', async () => {