Skip to content

Staging to Main Merge#10

Open
emadnahed wants to merge 4 commits intomainfrom
staging
Open

Staging to Main Merge#10
emadnahed wants to merge 4 commits intomainfrom
staging

Conversation

@emadnahed
Copy link
Owner

Summary

This PR merges the latest changes from staging to main, focusing on enhanced testing infrastructure, code cleanup, and improved test coverage across the React Native application.

Changes Included

Testing Enhancements

  • Detox E2E Testing: Enhanced end-to-end test coverage with improved movie search flow testing
  • Unit Test Coverage: Added comprehensive test suites for:
    • useDebounce hook with full edge case coverage
    • queryParser utility functions
    • MovieDetailsScreen component with expanded test scenarios
  • Integration Tests: Improved user flow integration tests with better structure and reliability

Configuration & Cleanup

  • API Configuration: Streamlined API config setup and removed unused code
  • Android Manifest: Cleaned up Android configuration
  • Dependencies: Updated and fixed test-related package imports
  • Code Structure: Refactored test organization and improved file structure

Application Improvements

  • SearchScreen: Minor enhancements and bug fixes
  • App Entry: Updated App.tsx for better testability

Stats

  • Files Changed: 9 files
  • Additions: +617 lines
  • Deletions: -41 lines
  • Net Change: +576 lines

Testing

  • All unit tests pass
  • Integration tests validated
  • E2E tests enhanced and passing
  • Detox configuration optimized

Merge Strategy

This PR includes commits from:

  • Feature: Enhanced test coverage and utilities
  • Fix: Updated test imports and dependencies
  • Refactor: Configuration cleanup and test structure improvements

Ready for production deployment with comprehensive testing coverage.

emadnahed and others added 4 commits March 7, 2026 15:48
- Add comprehensive test suites for useDebounce hook and queryParser utility
- Expand MovieDetailsScreen test coverage significantly
- Update movieSearch e2e tests with additional scenarios
- Minor updates to SearchScreen and App components
- Update Detox configuration
- Update package.json dependency version
- Fix import paths in integration and SearchScreen tests
- Minor test file adjustments
- Remove unused API configuration properties
- Update Android manifest permissions
- Refactor SearchScreen and proxy API for better maintainability
- Standardize test imports and structure across integration tests
- Update documentation and dependencies
This branch appears to be focused on testing improvements, particularly with Detox E2E testing framework, based on the recent commits that enhance test coverage, update dependencies, and refactor configuration for better test structure.
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates recent changes from the staging branch into main, primarily focusing on bolstering the application's testing capabilities and improving overall code health. It introduces more robust end-to-end, unit, and integration tests, alongside general code cleanup and configuration streamlining, to ensure a more stable and maintainable codebase.

Highlights

  • Testing Infrastructure: Enhanced Detox E2E tests, added comprehensive unit tests for useDebounce and queryParser, and expanded MovieDetailsScreen test scenarios.
  • Code Quality: Streamlined API configuration, cleaned up Android Manifest, updated dependencies, and refactored test organization.
  • Application Refinements: Implemented minor enhancements and bug fixes in SearchScreen and improved App.tsx for better testability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .detoxrc.js
    • Updated Detox device configurations for iOS and Android simulators.
  • App.tsx
    • Added a testID to the back button for improved testability.
  • README.md
    • Updated markdown headings for screenshots from # to ###.
  • android/app/src/main/AndroidManifest.xml
    • Removed the android:usesCleartextTraffic="true" attribute.
  • e2e/movieSearch.e2e.ts
    • Refactored Detox selectors to use testID instead of text.
    • Adjusted scroll depth in movie list tests.
    • Added new E2E tests for "Smart Search (Discover Mode)".
  • package.json
    • Removed test:maestro from the test:all script.
    • Removed the react-native-dotenv dependency.
  • src/tests/integration/user-flow.integration.test.tsx
    • Updated test selectors to use getByTestId.
    • Wrapped jest.advanceTimersByTime calls in act().
  • src/config/api.config.ts
    • Removed debug logging statements for react-native-config and API_CONFIG.
  • src/hooks/tests/useDebounce.test.ts
    • Added a new file containing comprehensive unit tests for the useDebounce custom hook.
  • src/screens/SearchScreen.tsx
    • Updated the empty state message.
    • Added testID attributes to the search input and clear button.
  • src/screens/tests/MovieDetailsScreen.test.tsx
    • Expanded unit tests for MovieDetailsScreen to cover loading, error states, and detailed display of movie information, including mocking the API query hook.
  • src/screens/tests/SearchScreen.test.tsx
    • Updated test selectors to use getByTestId.
    • Wrapped jest.advanceTimersByTime calls in act().
  • src/utils/tests/queryParser.test.ts
    • Added a new file containing comprehensive unit tests for the queryParser utility functions.
  • tmdb-proxy/api/proxy.ts
    • Implemented stricter validation for the proxy secret.
    • Adjusted the extraction of the tmdbPath from query parameters.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant step forward, merging a wide range of improvements from staging to main. The focus on enhancing the testing infrastructure is excellent, with major upgrades to E2E tests using testIDs for robustness, and the addition of comprehensive unit and integration test suites for hooks, utilities, and screens. The code cleanup, such as removing console logs and unused dependencies, and the security enhancements in the Android Manifest and the TMDB proxy are also valuable contributions.

I have found one critical issue in the TMDB proxy logic that could break API calls with multi-segment paths. Please see the detailed comment. Otherwise, the changes are of high quality and significantly improve the testability and maintainability of the codebase.

// Get the path from query parameter
const { path, ...otherParams } = req.query;
const tmdbPath = Array.isArray(path) ? path.join('/') : path;
const tmdbPath = Array.isArray(path) ? path[0] : path;

Choose a reason for hiding this comment

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

critical

This change from path.join('/') to path[0] for array-based paths appears to introduce a critical bug.

In many serverless environments (including Vercel), a file-based route like /api/proxy/[...path].ts will capture all path segments into an array. For example, a request to /api/proxy/movie/popular would result in req.query.path being ['movie', 'popular'].

The previous implementation path.join('/') would correctly reconstruct the path as movie/popular. The new implementation path[0] would incorrectly result in just movie, breaking all multi-segment API calls.

Please consider reverting this specific part of the change to use path.join('/') to ensure API paths are constructed correctly.

Suggested change
const tmdbPath = Array.isArray(path) ? path[0] : path;
const tmdbPath = Array.isArray(path) ? path.join('/') : path;

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.

1 participant