-
-
Notifications
You must be signed in to change notification settings - Fork 823
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
Fix: day or year view render on event page #3378
base: develop-postgres
Are you sure you want to change the base?
Fix: day or year view render on event page #3378
Conversation
WalkthroughThe pull request involves modifications to the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3378 +/- ##
=====================================================
+ Coverage 7.95% 89.69% +81.73%
=====================================================
Files 312 335 +23
Lines 8109 8634 +525
Branches 1803 1919 +116
=====================================================
+ Hits 645 7744 +7099
+ Misses 7397 631 -6766
- Partials 67 259 +192
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
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.
Please add tests to ensure this doesn't happen again.
… viewType in values in EventHeader
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: 0
🧹 Nitpick comments (1)
src/components/EventCalendar/EventCalendar.spec.tsx (1)
441-447
: Consider enhancing the hour view test coverage.While the test correctly verifies the presence of the hour view component, consider adding additional assertions to verify:
- The correct rendering of hour slots
- The proper display of events within the hour view
- Edge cases like events spanning multiple hours
This would provide better coverage for the day view rendering fixes mentioned in the PR objectives.
Here's a suggested enhancement to the test:
it('render the hour view', async () => { render(<Calendar eventData={eventData} viewType={ViewType.DAY} />); await wait(); const renderHourComponent = screen.getByTestId('hour'); expect(renderHourComponent).toBeInTheDocument(); + + // Verify hour slots are rendered + const hourSlots = screen.getAllByTestId(/hour-slot/); + expect(hourSlots).toHaveLength(24); // 24 hours in a day + + // Verify events are rendered in correct slots + const event = screen.getByText('Event 1'); + expect(event).toBeInTheDocument(); + expect(event.closest('[data-testid="hour-slot-10"]')).toBeInTheDocument(); // Event 1 starts at 10:00 });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/components/EventCalendar/EventCalendar.spec.tsx
(1 hunks)src/components/EventCalendar/EventCalendar.tsx
(3 hunks)src/components/EventCalendar/EventHeader.spec.tsx
(1 hunks)src/components/EventCalendar/EventHeader.tsx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/EventCalendar/EventCalendar.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test Application
🔇 Additional comments (2)
src/components/EventCalendar/EventHeader.spec.tsx (1)
52-52
: LGTM! Test identifiers updated correctly.The test now uses the correct test ID 'Day' which matches the component implementation, and properly wraps the async operation in an act() call.
src/components/EventCalendar/EventHeader.tsx (1)
92-94
: LGTM! Improved dropdown labels for better UX.The labels are now more user-friendly while maintaining the correct ViewType enum values internally.
Earlier- duplicate element visible on day and calendar view Now |
What kind of change does this PR introduce?
This PR will fix the rendering error on event page when select the year or day view.
We conditionally rendering the 'renderHours' function which has useMemo hook so react produce error "rendered more hooks than previous" so useMemo hook is removed from renderHour function.
Issue Number:
Fixes #3279
Snapshots/Videos:
Screen.Recording.2025-01-21.at.21.31.35.mov
If relevant, did you update the documentation?
N/A
Summary
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Refactor
Bug Fixes