Skip to content

Feat/app unit tests - #194

Closed
KarimmYasser wants to merge 23 commits into
devfrom
feat/app-unit-tests
Closed

Feat/app unit tests#194
KarimmYasser wants to merge 23 commits into
devfrom
feat/app-unit-tests

Conversation

@KarimmYasser

Copy link
Copy Markdown
Collaborator

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 AppBar component 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:

Testing Infrastructure Enhancements:

  • Expanded Jest setup with comprehensive mocks for Expo modules (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]
  • Added a memoized UserListFooter component for consistent list footers in user search results. [1] [2]

Project Configuration and Metadata:

  • Updated sonar-project.properties to reflect the new project version, adjust source and exclusion directories, and improve SonarQube analysis accuracy.
  • Enhanced package.json with project metadata such as description, repository, license, and homepage, providing better documentation and package management.
  • Added a Live Server port setting in .vscode/settings.json for improved local development experience.

KarimmYasser and others added 18 commits December 16, 2025 07:08
- 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.
…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.
…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.
…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.
…configuration; add comprehensive tests for notification hooks and tweet utilities
salehahmed99
salehahmed99 previously approved these changes Dec 16, 2025
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.

3 participants