fix expected err

This commit is contained in:
boufni95 2025-03-10 22:49:06 +00:00
parent 005add84bd
commit edd7476af1
4 changed files with 4 additions and 4 deletions

View file

@ -36,7 +36,7 @@ const testFailedExternalPayment = async (T: TestBase) => {
expect(invoice.payRequest).to.startWith("lnbcrt15u")
T.d("generated 1500 sats invoice for external node")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "not enough balance to decrement")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "Error: not enough balance to decrement")
T.d("payment failed as expected, with the expected error message")
const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId)
expect(u1.balance_sats).to.be.equal(1496)

View file

@ -35,7 +35,7 @@ const testFailedInternalPayment = async (T: TestBase) => {
const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry })
expect(invoice.invoice).to.startWith("lnbcrt10u")
T.d("generated 1000 sats invoice for user2")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "not enough balance to decrement")
await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "Error: not enough balance to decrement")
T.d("payment failed as expected, with the expected error message")
}

View file

@ -27,7 +27,7 @@ const testSpamExternalPayment = async (T: TestBase) => {
const successfulPayments = res.filter(r => r.success)
const failedPayments = res.filter(r => !r.success)
failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement"))
failedPayments.forEach(f => expect(f.err).to.be.equal("Error: not enough balance to decrement"))
successfulPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, network_fee: 1, service_fee: 3 }))
expect(successfulPayments.length).to.be.equal(3)
expect(failedPayments.length).to.be.equal(7)

View file

@ -30,7 +30,7 @@ const testSpamExternalPayment = async (T: TestBase) => {
const successfulPayments = res.filter(r => r.success) as { success: true, result: Types.PayInvoiceResponse }[]
const failedPayments = res.filter(r => !r.success)
failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement"))
failedPayments.forEach(f => expect(f.err).to.be.equal("Error: not enough balance to decrement"))
expect(successfulPayments.length).to.be.equal(3)
expect(failedPayments.length).to.be.equal(7)
T.d("3 payments succeeded, 7 failed as expected")