init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { PaymentMethod } from '../../modules/payment/types/PaymentMethod';
|
||||
import { resolveInvoiceRequiredConfirmations } from './resolveInvoiceRequiredConfirmations';
|
||||
|
||||
describe('resolveInvoiceRequiredConfirmations', () => {
|
||||
it('returns required confirmations for XMR invoices', () => {
|
||||
expect(
|
||||
resolveInvoiceRequiredConfirmations({
|
||||
paymentMethod: PaymentMethod.Xmr,
|
||||
moneroDetails: { requiredConfirmations: 3 }
|
||||
})
|
||||
).toBe(3);
|
||||
});
|
||||
|
||||
it('throws when monero details are missing', () => {
|
||||
expect(() =>
|
||||
resolveInvoiceRequiredConfirmations({
|
||||
paymentMethod: PaymentMethod.Xmr,
|
||||
moneroDetails: null
|
||||
})
|
||||
).toThrow('Invoice is missing Monero required confirmations');
|
||||
});
|
||||
|
||||
it('throws for unsupported payment methods', () => {
|
||||
expect(() =>
|
||||
resolveInvoiceRequiredConfirmations({
|
||||
paymentMethod: 'btc' as PaymentMethod
|
||||
})
|
||||
).toThrow('Unsupported payment method: btc');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user