add(feat): verification
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user