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

Refactor TestGetPersonCreatedBounties test from using MockDB To Real DB #1701

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

Refactor TestGetPersonCreatedBounties test from using MockDB To Real DB #1701

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

Comments

@elraphty
Copy link
Contributor

Context

Currently, we use a mock database to test the get-user-created 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 get-created bounty flow.

e.g

mockDb.On("GetCreatedBounty, "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
None yet
Development

Successfully merging a pull request may close this issue.

1 participant