test: increase messages and layout test coverage#204
Merged
Conversation
- Messages feature: 49% → 60.1% coverage (+66 tests) - Added comprehensive tests for MessageMenu, MessageItem, useMessageItem - Added ConversationItemWithUnseen tests (100% coverage) - Enhanced messageStore tests (96.23% coverage) - Added useConversationsList tests (80.64% coverage) - Removed all console logs from messages feature - Fixed mark-as-seen error handling - Layout feature: 0% → 19.25% coverage (+66 tests) - Created tests for Logo, ProfileSection, Footer, EmptySpace - Created tests for WhoToFollow, WhatIsHappening - Enhanced LayoutWrapper, MenuItems, PostButton tests - Enhanced LeftSidebar, RightSidebar, MobileBottomBar tests - All 72 layout tests passing Total: Added 132 new tests across both features
There was a problem hiding this comment.
Pull request overview
This PR significantly increases test coverage for the messages and layout features, bringing messages from 49% to 60.1% and layout from 0% to 19.25% by adding 132 new tests. The changes include comprehensive test suites for messaging components, hooks, and API interactions, along with layout component tests. Additionally, all console logs were removed from the messages feature for cleaner production code, and formatting improvements were applied across TypeScript interface definitions.
Key Changes
- Added 66 tests for messages feature covering MessageMenu, MessageItem, ConversationItem, hooks (useMessageItem, useConversationsList), and enhanced messageStore tests
- Added 66 tests for layout feature including Logo, ProfileSection, Footer, WhoToFollow, WhatIsHappening, and enhanced sidebar/navigation tests
- Removed all console.log statements from messages feature and improved error handling
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/ui.ts | Reformatted interface definitions onto single lines |
| src/components/ui/input/types.ts | Reformatted InputBaseProps interface definition |
| src/components/ui/forms/types.ts | Reformatted multi-line interface extends clauses |
| src/features/profile/hooks/tests/profileQueries.test.ts | Reformatted import statement |
| src/features/onboarding/hooks/useOnboarding.test.ts | Reformatted import statements |
| src/features/messages/tests/useMessageItem.test.ts | Added comprehensive tests for useMessageItem hook |
| src/features/messages/tests/useConversationsList.test.ts | Added 450 lines of tests for conversations list hook |
| src/features/messages/tests/messageStore.test.ts | Enhanced store tests from basic mocks to real implementation testing |
| src/features/messages/tests/api.test.ts | Enhanced API tests with actual endpoint testing |
| src/features/messages/tests/MessageMenu.test.tsx | Added tests for message menu component |
| src/features/messages/tests/MessageItem.test.tsx | Added comprehensive message item component tests |
| src/features/messages/tests/ConversationItemWithUnseen.test.tsx | Added full coverage tests for conversation item |
| src/features/messages/services/socket.ts | Removed console warning statements |
| src/features/messages/hooks/useSyncDMNotifications.ts | Removed console logging statements |
| src/features/messages/hooks/useMessages.ts | Removed console logging and updated comments |
| src/features/messages/hooks/useMarkDMNotificationsAsRead.ts | Removed console logging statements |
| src/features/messages/hooks/useConversationUnseenSync.ts | Removed console error logging |
| src/features/messages/hooks/useBlockStatus.ts | Removed console warning |
| src/features/messages/components/conversationlist/useConversationsList.ts | Removed console errors and improved timestamp formatting |
| src/features/messages/components/chatwindow/useChatWindow.ts | Removed console logging statements |
| src/features/messages/components/MessagesLayout.tsx | Removed console error statements |
| src/features/messages/api/messages.ts | Updated markMessagesSeen error handling and removed console errors |
| src/features/layout/tests/WhoToFollow.test.tsx | Added tests for WhoToFollow component |
| src/features/layout/tests/WhatIsHappening.test.tsx | Added tests for WhatIsHappening component |
| src/features/layout/tests/RightSidebar.test.tsx | Replaced placeholder with comprehensive tests |
| src/features/layout/tests/ProfileSection.test.tsx | Added tests for ProfileSection component |
| src/features/layout/tests/PostButton.test.tsx | Replaced placeholder with comprehensive tests |
| src/features/layout/tests/MobileBottomBar.test.tsx | Replaced placeholder with comprehensive tests |
| src/features/layout/tests/MenuItems.test.tsx | Replaced placeholder with comprehensive tests |
| src/features/layout/tests/Logo.test.tsx | Added tests for Logo component |
| src/features/layout/tests/LeftSidebar.test.tsx | Replaced placeholder with comprehensive tests |
| src/features/layout/tests/LayoutWrapper.test.tsx | Enhanced with comprehensive layout tests |
| src/features/layout/tests/Footer.test.tsx | Added tests for Footer component |
| src/features/layout/tests/EmptySpace.test.tsx | Added tests for EmptySpace component |
| .github/workflows/private-trigger.yml | Reformatted build command to multi-line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Messages feature: 49% → 60.1% coverage (+66 tests)
Layout feature: 0% → 19.25% coverage (+66 tests)
Total: Added 132 new tests across both features