Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend [Integration Test] bounty.go handlers PollInvoice For Organization Budget #1585

Closed
2 tasks
elraphty opened this issue Mar 5, 2024 · 4 comments · Fixed by #1598
Closed
2 tasks

Backend [Integration Test] bounty.go handlers PollInvoice For Organization Budget #1585

elraphty opened this issue Mar 5, 2024 · 4 comments · Fixed by #1598
Assignees
Labels
backend bounties go Pull requests that update Go code Posted testing
Milestone

Comments

@elraphty
Copy link
Contributor

elraphty commented Mar 5, 2024

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:

  • 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 BUDGET the invoice amount should be added to the organization budget and the payment status of the related invoice should be sent to true on the payment history table.

Bounty 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

References

Here is an example backend test

@AbdulWahab3181
Copy link
Contributor

AbdulWahab3181 commented Mar 5, 2024

@ecurrencyhodler Could you please assign me?

@elraphty elraphty added backend bounties go Pull requests that update Go code testing labels Mar 5, 2024
@elraphty elraphty added this to the UCI Tests milestone Mar 5, 2024
@MuhammadUmer44
Copy link
Contributor

Hi @ecurrencyhodler,
Please assign me?

@MuhammadUmer44
Copy link
Contributor

@ecurrencyhodler,
I have completed all bounties.

@ecurrencyhodler
Copy link
Contributor

@MuhammadUmer44 I'll assign you this one. But you have 2 other open bounties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bounties go Pull requests that update Go code Posted testing
Projects
Status: ✅ Done
4 participants