-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Added test for fund creator #3301
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
Added test for fund creator #3301
Conversation
WalkthroughThis pull request extracts and centralizes the logic for resolving the creator of a fund in the GraphQL API. The inline resolution is replaced by a dedicated Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant R as FundCreatorResolver
participant A as Auth Service
participant U as User Service
participant L as Logger
C->>R: Request fund creator data
R->>A: Check authentication from context
alt Not authenticated
R->>C: Return TalawaGraphQLError (unauthenticated)
else Authenticated
R->>R: Compare fund.creatorId with current user ID
alt creatorId is null or matches current user
R->>C: Return current user
else Valid creatorId
R->>U: Query user by creatorId
alt User not found
R->>L: Log warning
R->>C: Return error (unexpected state)
else User found
R->>C: Return retrieved user
end
end
end
Possibly related PRs
Suggested reviewers
Tip CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (15)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3301 +/- ##
====================================================
+ Coverage 48.56% 48.77% +0.20%
====================================================
Files 458 458
Lines 34533 34549 +16
Branches 976 995 +19
====================================================
+ Hits 16772 16850 +78
+ Misses 17761 17699 -62 ☔ View full report in Codecov by Sentry. |
@disha1202 PTAL |
@disha1202 any update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ee3c9df
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Test Implementation and Code Quality Enhancement
Issue Number:
Fixes #3068
If relevant, did you update the documentation?
No documentation update required as this is a test implementation.
Summary
Implementation of unit tests for the Fund creator field resolver
Coverage of authentication and authorization scenarios
Testing of edge cases and error handling
Proper typing of test context objects to improve code quality
Implementation of mocking strategies for database interactions
These tests ensure the robust functionality of the venue creator resolver while maintaining high code quality standards.
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Test implementation follows Vitest testing patterns
Includes proper mocking of database interactions
Maintains type safety throughout the implementation
Follows project coding standards and best practices
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Refactor