Skip to content

test: increase messages and layout test coverage#204

Merged
AMYasserF merged 1 commit intodevfrom
test/increasing-unit-test-coverage
Dec 15, 2025
Merged

test: increase messages and layout test coverage#204
AMYasserF merged 1 commit intodevfrom
test/increasing-unit-test-coverage

Conversation

@AMYasserF
Copy link
Contributor

  • 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

- 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
Copilot AI review requested due to automatic review settings December 15, 2025 19:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@AMYasserF AMYasserF merged commit ad87332 into dev Dec 15, 2025
2 checks passed
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.

2 participants