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

Update TestCreateOrEditBounty tests from using MockDB To Real DB #1694

Closed
4 tasks
elraphty opened this issue Jun 17, 2024 · 0 comments · Fixed by #1695
Closed
4 tasks

Update TestCreateOrEditBounty tests from using MockDB To Real DB #1694

elraphty opened this issue Jun 17, 2024 · 0 comments · Fixed by #1695
Assignees
Labels

Comments

@elraphty
Copy link
Contributor

elraphty commented Jun 17, 2024

Context

Currently, we use a mock database to test the create bounty flow

mockDb := dbMocks.NewDatabase(t)
mockHttpClient := mocks.NewHttpClient(t)
bHandler := NewBountyHandler(mockHttpClient, mockDb

Design

We want to update the mock DB to a real database spun up on a docker container and test with the DB.

bHandler := NewBountyHandler(mockClient, db.TestDB)

We will remove all the mock DB functions, and use real database DB functions used in production to test the create bounty flow.
e.g

mockDb.On("CreateOrEditBounty", "pub-key", "1111").Return(db.NewBounty{}, errors.New("some-error")).Once()

Acceptance Criteria

  • I've tested on Chrome
  • I've created a test that...
  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 1 day of taking the bounty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant