Skip to content

Commit

Permalink
Merge pull request #245 from getAlby/fix/0-amount-incoming-test
Browse files Browse the repository at this point in the history
Add test for invoice list with zero amount invoices
  • Loading branch information
kiwiidb committed Dec 9, 2022
2 parents 652567d + d93c0fb commit 4624662
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions integration_tests/incoming_payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ func (suite *IncomingPaymentTestSuite) TestIncomingPaymentZeroAmt() {
assert.NoError(suite.T(), json.NewDecoder(rec.Body).Decode(&balance))
//assert the payment value was added to the user's account
assert.Equal(suite.T(), initialBalance+int64(sendSatAmt), balance.BTC.AvailableBalance)

//check transaction list
req = httptest.NewRequest(http.MethodGet, "/getuserinvoices", &buf)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", suite.userToken))
suite.echo.ServeHTTP(rec, req)
invoices := make([]ExpectedIncomingInvoice, 1)
assert.Equal(suite.T(), http.StatusOK, rec.Code)
assert.NoError(suite.T(), json.NewDecoder(rec.Body).Decode(&invoices))
//assert the payment value was added to the user's account
assert.Equal(suite.T(), int64(sendSatAmt), invoices[0].Amount)
}
func (suite *IncomingPaymentTestSuite) TestIncomingPaymentKeysend() {
var buf bytes.Buffer
Expand Down

0 comments on commit 4624662

Please sign in to comment.