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 [Unit Test] db/config.go CheckUser, & RolesCheck #1596

Closed
wants to merge 1 commit into from

Conversation

Fog3211
Copy link
Contributor

@Fog3211 Fog3211 commented Mar 7, 2024

Describe your changes

Backend [Unit Test] db/config.go CheckUser, & RolesCheck

image

Issue ticket number and link

closes #1562

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested on Chrome and Firefox
  • I have tested on a mobile device
  • I have provided a screenshot or recording of changes in my PR if there were updates to the frontend

@Fog3211
Copy link
Contributor Author

Fog3211 commented Mar 7, 2024

@elraphty @ecurrencyhodler Sorry I only finish test for CheckUser and RolesCheck func, can't finish test for UserHasManageBountyRoles, UserHasAccess func( I tried many ways but all failed 😭, like this)

When I use the global variable DB, a null pointer error will be reported.
When I try to introduce mockDB, I will be prompted that I cannot reference circularly.
When I implement a mock DB myself, I will be prompted that the type is incorrect.

@Fog3211 Fog3211 marked this pull request as ready for review March 7, 2024 18:36
@elraphty elraphty closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend [Unit Test] db/config.go UserHasManageBountyRoles, UserHasAccess, CheckUser, & RolesCheck
2 participants