add(feat): verification
This commit is contained in:
@@ -17,13 +17,18 @@ const eWalletService = require('../../app/modules/e-wallet/services/e-wallet.ser
|
||||
describe('EWalletService', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
process.env.PROJECT_ID = 'CBT';
|
||||
});
|
||||
|
||||
it('should create a gopay transaction successfully', async () => {
|
||||
const payload = { order_id: 'u-123', external_id: 'INV-G-001', amount: 25000 };
|
||||
mockCharge.mockResolvedValue({ status_code: '201' });
|
||||
const result = await eWalletService.createTransaction(payload, 'gopay');
|
||||
expect(mockCharge).toHaveBeenCalled();
|
||||
expect(mockCharge).toHaveBeenCalledWith(expect.objectContaining({
|
||||
transaction_details: expect.objectContaining({
|
||||
order_id: 'INV-G-001-CBT'
|
||||
})
|
||||
}));
|
||||
expect(result.status_code).toBe('201');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user