Feat/app unit tests - #194
Closed
KarimmYasser wants to merge 23 commits into
Closed
Conversation
- Updated tests across various components to replace direct router calls with global mock functions for navigation (e.g., `mockReplace`, `mockNavigate`, `mockGoBack`). - Removed unnecessary mocks for `expo-router` and streamlined the setup for navigation in tests. - Enhanced test readability by consolidating mock setups and ensuring consistent use of mocked navigation functions. - Adjusted assertions in tests to reflect the new navigation mock structure, ensuring that navigation behavior is accurately tested. - Improved the handling of timers and mock functions in tests for better isolation and reliability.
…ss multiple files
…arious screens - Implement tests for MutedUsersScreen to verify muted users logic, including initialization, loading, unmuting, and displaying user information. - Add tests for NotificationsScreen to ensure notifications are loaded, filtered, marked as read, and navigated correctly. - Create tests for SearchLayout and SearchResultsScreen to validate search functionality, including query handling, filtering, and theme application. - Develop tests for TweetActivityScreen and TweetDetailScreen to check tweet interactions, including likes, reposts, and navigation to user profiles. - Introduce tests for LikesScreen to confirm likes loading, sorting, and user interactions such as following and blocking.
…action logic in various screens
…configuration; add comprehensive tests for notification hooks and tweet utilities
- Updated tests across various components to replace direct router calls with global mock functions for navigation (e.g., `mockReplace`, `mockNavigate`, `mockGoBack`). - Removed unnecessary mocks for `expo-router` and streamlined the setup for navigation in tests. - Enhanced test readability by consolidating mock setups and ensuring consistent use of mocked navigation functions. - Adjusted assertions in tests to reflect the new navigation mock structure, ensuring that navigation behavior is accurately tested. - Improved the handling of timers and mock functions in tests for better isolation and reliability.
…ss multiple files
…arious screens - Implement tests for MutedUsersScreen to verify muted users logic, including initialization, loading, unmuting, and displaying user information. - Add tests for NotificationsScreen to ensure notifications are loaded, filtered, marked as read, and navigated correctly. - Create tests for SearchLayout and SearchResultsScreen to validate search functionality, including query handling, filtering, and theme application. - Develop tests for TweetActivityScreen and TweetDetailScreen to check tweet interactions, including likes, reposts, and navigation to user profiles. - Introduce tests for LikesScreen to confirm likes loading, sorting, and user interactions such as following and blocking.
…action logic in various screens
…configuration; add comprehensive tests for notification hooks and tweet utilities
…ction, and count formatting utilities
salehahmed99
previously approved these changes
Dec 16, 2025
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.
This pull request introduces several improvements and refactors across the codebase, focusing on UI consistency, test setup enhancements, and project configuration updates. The most significant changes include refactoring how children are passed to the
AppBarcomponent for improved readability and maintainability, expanding Jest test mocks for better test coverage, and updating project configuration files for clarity and accuracy.UI Consistency and Refactoring:
AppBarcomponent to pass children via JSX rather than thechildrenprop, improving code clarity and aligning with standard React patterns. This affects files such asexplore.tsx,search-results.tsx,search-suggestions.tsx, andtweets/[tweetId]/index.tsx. [1] [2] [3] [4] [5] app/(protected)/tweets/[tweetId]/index.tsxL87, app/(protected)/tweets/[tweetId]/index.tsxL124-R124)MuteAndBlockHeaderComponent,MutedAccountsHeaderComponent,BlockedAccountsHeaderComponent) inMuteAndBlock/_layout.tsxto standardize header rendering for mute and block settings screens. [1] [2] [3] [4]Testing Infrastructure Enhancements:
expo-image,expo-router,expo-modules-core,expo-constants,expo-device,expo-notifications,expo-audio) and custom navigation hooks, improving test reliability and isolation. [1] [2] [3] [4]UserListFootercomponent for consistent list footers in user search results. [1] [2]Project Configuration and Metadata:
sonar-project.propertiesto reflect the new project version, adjust source and exclusion directories, and improve SonarQube analysis accuracy.package.jsonwith project metadata such as description, repository, license, and homepage, providing better documentation and package management..vscode/settings.jsonfor improved local development experience.