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 MakeBountyPayment #1564

Closed
2 tasks
elraphty opened this issue Feb 27, 2024 · 7 comments · Fixed by #1595
Closed
2 tasks

Backend [Integration Test] bounty.go handlers MakeBountyPayment #1564

elraphty opened this issue Feb 27, 2024 · 7 comments · Fixed by #1595
Assignees
Labels
backend bounties go Pull requests that update Go code Posted testing
Milestone

Comments

@elraphty
Copy link
Contributor

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:

  • Mock a call to /payment to make the bounty payment
  • Should test that If the payment is successful the payment gets added to the payment history, the bounty paid is updated to true, the bounty paid date is updated, and the bounty completion date is updated
  • Should test that if /payment is successful, the organization budget gets reduced by the bounty amount.
  • Should test that a successful WebSocket message is sent if the payment is successful
  • Should test that an error WebSocket message is sent if the payment fails

Bounty Handlers To Test

MakeBountyPayment

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

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

@ecurrencyhodler assign me?

@ecurrencyhodler ecurrencyhodler moved this from 🆕 New to 🧨 To Do in Bounties Platform Feb 27, 2024
@arimusdev
Copy link

@ecurrencyhodler assign me please

@gouravmpk
Copy link
Contributor

Assign

@ecurrencyhodler
Copy link
Contributor

Let's get a PR up in 2 days.

@gouravmpk
Copy link
Contributor

@ecurrencyhodler this is done all the tests are passing but one I will resolve it and get pr by tonight

@AbdulWahab3181
Copy link
Contributor

AbdulWahab3181 commented Mar 5, 2024

@ecurrencyhodler Could you please assign me?

@ecurrencyhodler
Copy link
Contributor

paid

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
Development

Successfully merging a pull request may close this issue.

6 participants