You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to increase the test coverage for our Golang backend.
File to to test
handlers/bounty.go
Design
Write tests for the bounty handlers, the test should:
Should test that a 401 error is returned if a user is unauthorized
Mock a call to relay GET /invoice?payment_request=${paymentRequest} to get the status of the invoice
If there is an invoice error a 403 status error should be returned
If the invoice is settled and the invoice.Type is equal to KEYSEND mock a keysend payment to relay /payment with body request of bodyData := utils.BuildKeysendBodyData(amount, invData.UserPubkey, invData.RouteHint)
If the mock relay payment is successful update the bounty associated with the invoice and set the paid = true.
Tribes Handlers To Test
PollInvoice
Add tests to bounty_test.go
Acceptance Criteria
I have rebased and tested locally before submitting my PR
I can submit a PR within 2 days of taking the bounty
Context
We are trying to increase the test coverage for our Golang backend.
File to to test
handlers/bounty.go
Design
Write tests for the bounty handlers, the test should:
/invoice?payment_request=${paymentRequest}
to get the status of the invoiceinvoice.Type
is equal toKEYSEND
mock a keysend payment to relay/payment
with body request ofbodyData := utils.BuildKeysendBodyData(amount, invData.UserPubkey, invData.RouteHint)
paid = true
.Tribes Handlers To Test
Add tests to
bounty_test.go
Acceptance Criteria
References
Here is an example backend test
The text was updated successfully, but these errors were encountered: