-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
add Unittests for lib/widgets/event_card.dart #2669
add Unittests for lib/widgets/event_card.dart #2669
Conversation
WalkthroughThe pull request adds two new test cases for the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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:
Other🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise. |
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
test/widget_tests/widgets/event_card_test.dart (2)
199-212
: Add test cleanup and improve test descriptionThe test correctly verifies the Created row visibility, but could be improved:
- Add
tearDown
to resetuserConfig.currentUser.id
after the test- Consider a more descriptive test name like "should show Created row and verified icon when current user is the event creator"
+ tearDown(() { + userConfig.currentUser.id = null; // or default value + }); - testWidgets('Check for Created Row visibility', (tester) async { + testWidgets('should show Created row and verified icon when current user is the event creator', (tester) async {
198-228
: Consider adding edge case testsWhile the current test coverage is good, consider adding these edge cases:
- Test with null creator
- Test with empty location/description
- Test with very long text content to verify truncation
- Test with different date formats
Would you like me to provide example test cases for these scenarios?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2669 +/- ##
====================================================
+ Coverage 95.94% 96.10% +0.16%
====================================================
Files 187 187
Lines 9887 9887
====================================================
+ Hits 9486 9502 +16
+ Misses 401 385 -16 ☔ View full report in Codecov by Sentry. |
|
@noman2002 PTAL |
@noman2002 please review. |
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
0e8b559
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Unittests for lib/widgets/event_card.dart
Issue Number:
Fixes #2618
Did you add tests for your changes?
Yes
Snapshots/Videos:
Have you read the contributing guide?
Yes
Summary by CodeRabbit
EventCard
widget to verify visibility of the "Created" row based on the current user's status as the event creator.